Redirecting from /forum/ to root with nginx

Brent W

Well-known member
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.


Well-known member
Not sure if this is solved or not, but this will do it:

        location /forum/ {
                rewrite ^/forum/(.*)$ /$1 redirect;