在使用TP5 的时候,默认路径index.php是入口文件,加载每一个模块的时候都要将index.php的默认路径带上,就像这样:
http://xy.tohu.xin/index.php/admin/index/index.html。
解决方案:修改项目根目录下的配置文件.htaccess文件。
原来的文件内容如下:
<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>
修改文件中的rewriteRule即可,修改后的文件内容如下:
<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>