XF 2.2 PHPBB nginx redirects?

Blackbeard

Well-known member
I'm running a conversion for a PHP 3.x to XF 2.2. It went well, but I'm looking for any help someone might can offer for nginx redirect rules.

I've tried the following thread https://xenforo.com/community/resou...phpbb-3-2-3-3-without-seo-urls-htaccess.7838/

With the htaccess, I used a tool to convert them over.

NGINX:
if ($query_string ~* "(^|&)t=([0-9]+)(&|$)"){
rewrite ^/forum/viewtopic\.php$ /threads/$arg_t/? redirect;  }

if ($query_string ~* "f=(\d+)$"){
rewrite ^/forum/(viewforum\.php|viewtopic\.php)$ /forums/$arg_f/? redirect;  }

if ($query_string ~* "(^|&)p=([0-9]+)(&|$)"){
rewrite ^/forum/viewtopic\.php$ /posts/$arg_p/? redirect;  }

Sadly these redirect rules did not work -

I was moving the /forum/ software to the root directory.

Here are my url examples:

Url examples
https://www.domain.com/forum/viewforum.php?f=7
http://domain.com/forum/viewtopic.php?t=115139

https://www.domain.com/forums/disney-dining.7/
https://www.domain.com/threads/mickey-meet-n-greets.115139/


Any help would be appreciated!
 
This is working for my site:


NGINX:
if ( $arg_p ) {
                rewrite ^\/viewtopic\.php posts/$arg_p/? permanent;
        }
        if ( $arg_t ) {
                rewrite ^\/viewtopic\.php threads/$arg_t/? permanent;
        }
        rewrite ^\/viewforum\.php forums/$arg_f/? permanent;
 
Back
Top Bottom