时间:2021-07-01 10:21:17 帮助过:19人阅读
<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>
上述配置失效时,可更改为:
<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>
如果用的phpstudy,规则如下:
<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>
可以在Nginx.conf中添加:
location / { // …..省略部分代码 if (!-e $request_filename) { rewrite ^(.*)$ /index.php?s=/$1 last; break; } }
原文链接:http://xqitw.com/path_info-hide-index.html
htaccess 一般配置
标签:lin highlight nginx服务 module hid tac htaccess tle view