首页 > 数据库技术 > 详细

thinkphp 3.+ Apache url重写问题(.htaccess)

时间:2019-07-17 17:11:07      阅读:198      评论:0      收藏:0      [点我收藏+]
手册为:
<IfModule mod_rewrite.c> 
RewriteEngine on 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteRule ^(.*)$ index.php/$1 [QSA,PT,L]  (注意:此处需要加个问号index.php?/$1)
</IfModule>
正确的配置为:
<IfModule mod_rewrite.c>
Options +FollowSymlinks
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php?s=$1 [QSA,PT,L]
</IfModule>
或:
<IfModule mod_rewrite.c>
  Options +FollowSymlinks
  RewriteEngine On
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond $1 !^(index.php|images|robots.txt)  
  RewriteRule ^(.*)$ /index.php?/$1 [L]
</IfModule>

  

thinkphp 3.+ Apache url重写问题(.htaccess)

原文:https://www.cnblogs.com/jiang-xy/p/11201365.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!