通过这篇文章,将CodeIgniter框架用到的伪静态规则
第一、Nginx规则
location / {
if (!-e $request_filename) {
rewrite ^/(.+)$ /index.php/$1 last;
}
}
第二、Apache规则
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L]
记录一下,以后可能需要用到。