Converting Mod-rewrite rules which use %(QUERY_STRING) to NGINX rewrite format?
- by HipHop-opatamus
I've been stuck the last few days trying to convert the following Apache/Mod_Rewrite rewrite rule to NGINX format. Anyone know where I am going wrong?
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;
}
}