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 2014-02-27 14:25:00 +08:00
|
3
tielv OP |
4
tielv OP 是crazyphper.com吧?
|
5
wolftankk 2014-03-01 11:46:18 +08:00
如果你的地址都是类似于这样 http://www.example.com/login
这样的话可以这么写 location .*.php { if (!- e $request_filename) { rewrite ^(.*)$ /index.php/$1 break; } } |
6
zhangzilong 2017-04-21 13:38:05 +08:00
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/ |