thinkphpThinkPHPThinkPHP

ThinkPHP5.0.10 - URL重写问题

2017-08-01  本文已影响15人  诗无尽头i
图片镇楼

至于为什么重写。。还是因为懒

官方给的apache的.htaccess PHP版本超过5.5以上会出现这个错误
这是官方给的.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 ^(.)$ index.php/$1 [QSA,PT,L]
修改成
RewriteRule ^(.
)$ index.php [L,E=PATH_INFO:$1]

修改过的.htaccess
<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>

--End--

我是诗无尽头°十八岁的少年,如果我的文章对您有用的话麻烦点个赞
诗无尽头° © 爱源客博客

上一篇下一篇

猜你喜欢

热点阅读