
1 tielv OP PHP+apache的伪静态规则如下: RewriteEngine on RewriteCond $1 !^(index\.php|templates|upload|images|js|css|cache|plugins|spec|favicon\.ico|robots\.txt|phpmyadmin) RewriteRule ^(.*)$ /index.php/$1 [L] |
2 konakona Feb 27, 2014 |
3 tielv OP |
5 wolftankk Mar 1, 2014 如果你的地址都是类似于这样 http://www.example.com/login 这样的话可以这么写 location .*.php { if (!- e $request_filename) { rewrite ^(.*)$ /index.php/$1 break; } } |
6 zhangzilong Apr 21, 2017 if ($1 !~ "^(index\.php|templates|upload|images|js|css|cache|plugins|spec|favicon\.ico|robots\.txt|phpmyadmin)"){ set $rule_0 1$rule_0; } if ($rule_0 = "1"){ rewrite ^/(.*)$ /index.php/$1 last; } 推荐一个 将 apache 重写规则在线转为 nginx 重写规则的工具: http://www.51ask.org/apache2nginx/ |