nginx: Redirecting route?

koa

Member
When a url matches /forums/threads/{?} I need it to rewrite too /threads/{?}. How can I do this?

Xenforo's built in route system doesn't fix this.
 
In short, you can't. You will need the precursor to /threads there. IT can be something as simple as /f/threads, but it's impossible to remove a route in the /forum area AFAIK.
Trying to do an nginx rewrite won't work as I've never seen it successfully done. Is there a reason you are trying to remove the forum/ from the link?
 
In short, you can't. You will need the precursor to /threads there. IT can be something as simple as /f/threads, but it's impossible to remove a route in the /forum area AFAIK.
Trying to do an nginx rewrite won't work.

The home isn't the forum, theres /forums/ but when you go to a thread its /thread/
 
If you put it in a subdirectory called forum or forums off your root, you are then going to have /forum(s)/forums. Simply rename that subdirectory to /community or something similar like what is done here and then you have community/forums or community/threads.
The /forums and threads are a natural part of the script. There is no way to get rid of them as they are built in routes. Trying to do nginx rewrites won't work out the way you are wanting.
 
If you put it in a subdirectory called forum or forums off your root, you are then going to have /forum(s)/forums. Simply rename that subdirectory to /community or something similar like what is done here and then you have community/forums or community/threads.
The /forums and threads are a natural part of the script. There is no way to get rid of them as they are built in routes. Trying to do nginx rewrites won't work out the way you are wanting.

So no way to reroute when someone goes to `/forums/threads/{?}`? Even though going to that url doesn't work at all.
 
So no way to reroute when someone goes to `/forums/threads/{?}`? Even though going to that url doesn't work at all.
Is /forums the subdirectory you have the XF script in?
Pretty sure you are not going to be able to do exactly what you are trying to.
 
Last edited:
Then it is working as it is supposed to it sounds like.

I think you are actually getting confused. If the article/portal page is created by XF, then your XF site is actually in the root and you are using a route index to point to the portal/article page as your landing page. Then your forums will show up on /forums. It's simply the way the script works.
You can change the /forums to something shorter, but it still has to be present. You will not be able to use NGINX redirects to eliminate the /forums or the /threads segments of the URL.

What exactly about those is effecting your site?
 
Top Bottom