Apache服务器.htaccess伪静态设置
RewriteEngine on RewriteCond $1 !^(index\.php|system\.php|images|skin|js|ls|swfupload|attachment|application|robots\.txt) RewriteRule ^(.*)$ /fx/index.php/$1 [L]
Nginx服务器伪静态设置
location / { root /var/www/html/; index index.html index.htm index.php; if ($request_filename !~* /(js|css|img|uploads|resources|robots.txt|index.php)) { rewrite ^/(.*)$ /index.php?$1 last; }
}
注:如在全局设置了root和index,此处就不需要这两项设置。
IIS服务器web.config伪静态设置
<system.webServer> <rewrite> <rules> <rule name="Imported Rule 1" stopProcessing="true"> <match url="^/(.*)$" ignoreCase="false" /> <conditions logicalGrouping="MatchAll"> <add input="{R:1}" pattern="^(index.php|images|styles|scripts|uploads|resources|robots.txt)" ignoreCase="false" negate="true" /> </conditions> <action type="Rewrite" url="/index.php/{R:1}" /> </rule> </rules> </rewrite> </system.webServer>
httd.ini伪静态设置
RewriteRule ^/(?:images|styles|scripts|uploads|resources)/(.*) $0 [L] RewriteRule ^/(.*)$ /$1/index.php/$2 [L]