一:
官方文件:
- <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>
修改后的文件 :
- <pre code_snippet_id="2463884" snippet_file_name="blog_20170629_4_2585774" name="code" class="plain"><IfModule mod_rewrite.c>
- Options +FollowSymlinks -Multiviews
- RewriteEngine On
- RewriteCond %{REQUEST_FILENAME} !-d
- RewriteCond %{REQUEST_FILENAME} !-f
- RewriteRule ^(.*)$ index.php?s=$1 [QSA,PT,L]
- 改了最后一句:RewriteRule ^(.*)$ index.php?s=$1 [QSA,PT,L]
二:
RewriteRule ^(.*)$ index.php?s=$1 [QSA,PT,L]
或者
RewriteRule ^(.*)$ index.php [L,E=PATH_INFO:$1]