1)支持重寫php
2)兼容所有APACHE servernginx
3)假設不是文件,請求的結尾不包含反斜槓,本身主動跳轉到反斜槓code
4)文件名稱 .htaccessserver
5)這個放到nginxserver怎麼都不支持重寫,假設有知道的人,告訴我一下,特別感謝 default7#zbphp.com。blog
<IfModule mod_rewrite.c> RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_URI} !(.*)/$ RewriteRule ^(.*)$ /$1/ [L,R=301] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d #RewriteRule ^(.*)$ index.php/$1 [PT,QSA,L] RewriteRule ^(.*)$ index.php?/$1 [PT,QSA,L] </IfModule>
#更新綁定主域名#ip
<IfModule mod_rewrite.c> RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_URI} !(.*)/$ RewriteRule ^(.*)$ /$1/ [L,R=301] RewriteCond %{HTTP_HOST} !^m.zbphp.com [NC] RewriteRule ^(.*)$ http://m.zbphp.com/$1 [L,R=301] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d #RewriteRule ^(.*)$ index.php/$1 [PT,QSA,L] RewriteRule ^(.*)$ index.php?/$1 [PT,QSA,L] </IfModule>