【发布时间】:2015-07-08 20:16:39
【问题描述】:
我用的是neginx,那我需要把htaccess重写规则转成neginx重写规则。我使用this 进行转换。现在我想知道我应该如何使用输出?
.htaccess:
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?rt=$1 [L,QSA]
ErrorDocument 404 /error404.html
nginx 规则: (输出)
if (!-f $request_filename){
set $rule_0 1$rule_0;
}
if (!-d $request_filename){
set $rule_0 2$rule_0;
}
if ($rule_0 = "21"){
rewrite ^/(.*)$ /index.php?rt=$1 last;
}
我应该如何使用输出?
需要注意的是,我在不同的文件夹中有多个 .htaccess (3 个不同的文件夹中有 3 个 .htaccess 文件)
【问题讨论】:
标签: php apache .htaccess nginx webserver