Redirecting from /forum/ to root with nginx

Brent W

Well-known member
Licensed customer
We recently bought a forum and they installed xenforo in /forum/. We would like to move the forum to root and redirect all old urls to the new ones. I did a google site search but only seemed to find going from root to a sub directory, not the other way around.
 
Code:
rewrite /forum/(.*) https://domain.com/$1 301;

Something like that may work
 
Not sure if this is solved or not, but this will do it:

Code:
        location /forum/ {
                rewrite ^/forum/(.*)$ /$1 redirect;
        }
 
Back
Top Bottom