【发布时间】:2015-11-07 17:49:16
【问题描述】:
我的子域中有以下 .htaccess 文件。
我的网站有http://hello/forum/index.php,并且想隐藏这个index.php 文件,并使其成为http://hello/forum。
每当我使用附加的.htaccess 时,它都会指向http://hello,而不是http://hello/forum。我错过了什么吗?
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{THE_REQUEST} ^GET.*index\.php [NC]
RewriteCond %{REQUEST_URI} !/system/.* [NC]
RewriteRule (.*?)index\.php/*(.*) forum/$1$2 [R=301,NE,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ forum/index.php/$1 [L]
</IfModule>
【问题讨论】:
标签: .htaccess mod-rewrite url-rewriting friendly-url