XF 2.3 Redirects for deleted thread URLs (threads/ID) not working

USCSS_Nostromo

Well-known member
Licensed customer
I have a problem with routing for threads.

I’m referring to what is located here: /admin.php?route-filters

For example, I have a deleted thread with ID 777.
I create a route:

Find route: threads/777/
Replace with: threads/888/

But it doesn’t work…

I’ve tried everything - with a leading slash, without a trailing slash, tried redirecting to /index.php or to any other page. Nothing works.

Routing works with other URLs (not with threads).

Please help.
 
Solution
There's a common misunderstanding sometimes with how route filters work, and for redirects it's usually the opposite of what you think:

1782489479335.webp

In this example thread 1 is deleted, and thread 100 is the visible thread.

You also need to be careful of the string inside the thread title, assuming you have them enabled. The match is explicit, so threads/<title>.1/ is not the same as threads/1/

It's confusing at times, but this is what will work for your use case.
this might be better suited with redirect rules? route filters seems a bit much for redirecting a single thread? iirc it is designed to redirect entire pathways like if you want to rename threads to something else.
 
i see that. it is indeed weird. they do suggest using wildcard in the replace with section so there's that. main page of the feature mention this: Route filters allow you to change the standard URLs generated by XenForo. this is what i have always imagined it to be. for instance i used this feature to replace forums with f and threads with t for a while but reverted the behavior later on. but i guess it might be possible to use it for a single redirect?

personally, i would use this addon: https://xenforo.com/community/resources/custom-404-page-by-siropu.7188/. it makes it astonishingly easy to manage tons of redirect rules from xenforo backend.
 
There's a common misunderstanding sometimes with how route filters work, and for redirects it's usually the opposite of what you think:

1782489479335.webp

In this example thread 1 is deleted, and thread 100 is the visible thread.

You also need to be careful of the string inside the thread title, assuming you have them enabled. The match is explicit, so threads/<title>.1/ is not the same as threads/1/

It's confusing at times, but this is what will work for your use case.
 
Solution
Back
Top Bottom