商城隐藏index.php入口文件
无论apache服务器中有多少目录,多少站点
只修改此站点下顶级目录下的.htaccess即可
DSmall给出代码:
Options +FollowSymlinks -Multiviews
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php [L,E=PATH_INFO:$1]
TP官方所给出代码:
<IfModule mod_rewrite.c>
Options +FollowSymlinks -Multiviews
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php [L,E=PATH_INFO:$1]
</IfModule>
实则验证后可正常运行代码
<IfModule mod_rewrite.c>
Options +FollowSymlinks -Multiviews
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ /index.php?/$1 [QSA,PT,L]
</IfModule>
除此之外还需要
打开环境配置文件:http.conf,设置 AllowOverride None 为 AllowOverride All,一共三处;
http.conf文件加载mod_rewrite 模块。
一懒众衫小