I'm using IPB forums. I managed to use friendly urls with nginx server conf modifications. However I need to redirect my old forum's URLs to a redirector php file to get current url of a topic (or forum, member etc.). For example: if url is like /forum/index.php?board=23
, I will do a redirection to redirector.php .
This is my current configuration to be able to use friendly URLs on IPB
location /forum {
try_files $uri $uri/ /forum/index.php;
rewrite ^ /forum/index.php? last;
}
When I do insert an if statement inside this location block like the following, I can not retrieve query parameter "board".
location /forum {
if ($arg_board != "") {
rewrite ^ /redirector.php?q=$arg_board break;
}
try_files $uri $uri/ /forum/index.php;
rewrite ^ /forum/index.php? last;
}
What is missing in here?