<IfModule mod_rewrite.c>
Options +FollowSymli
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php/$1 [QSA,PT,L]
</IfModule>
只需要改成这样(只有最后一行有所改变):
<IfModule mod_rewrite.c>
Options +FollowSymli
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php [L,E=PATH_INFO:$1]
</IfModule>
就可以达到隐藏index.php的效果(高手勿喷,给自己做些小笔记)
最佳答案