美文网首页thinkphpThinkPHPThinkPHP
ThinkPHP5.0.10 - URL重写问题

ThinkPHP5.0.10 - URL重写问题

作者: 诗无尽头i | 来源:发表于2017-08-01 21:54 被阅读15次
图片镇楼

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

官方给的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--

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

相关文章

网友评论

    本文标题:ThinkPHP5.0.10 - URL重写问题

    本文链接:https://www.haomeiwen.com/subject/tyyslxtx.html