手册为: <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