【发布时间】:2011-01-27 09:28:35
【问题描述】:
过去几天我一直在尝试将以下 Apache/Mod_Rewrite 重写规则转换为 NGINX 格式。有人知道我哪里出错了吗?
MOD_REWRITE:
RewriteCond %{QUERY_STRING} topic=([0-9]+)
RewriteRule /forum/index\.php /forum/vbseo301.php?action=thread&oldid=%1 [L]
NGINX:
location /forum/index.php {
if ($args ~ "topic=([0-9]+)"){
rewrite ^/forum/index\.php?topic=(.+)$ /forum/vbseo301.php?action=thread&oldid=$1 last;
}
}
【问题讨论】:
标签: .htaccess mod-rewrite url-rewriting nginx