Fixed Route filter for misc/contact/

JoyFreak

Well-known member
Affected version
2.1.7
I've added a router filter to replace misc/contact/ with contact/ but it doesn't seem to redirect the misc/contact/ to contact/ ?
 
It isn't a redirect like .htaccess, its just a route filter. So you can set new route names for existing routes. But if you go directly to the old route it works also like the new route.
 
It isn't a redirect like .htaccess, its just a route filter. So you can set new route names for existing routes. But if you go directly to the old route it works also like the new route.
The old route should redirect to the new route. That's how all the other route filter works. But in this case, it doesn't. Just wondered why it behaves differently or whether it's just a bug?
 
You're right. It works with media/ => medien/, but it doesn't work with help/ or misc/contact/

But it works with help/trophies/ => hilfe/trophies/, so something went wrong if the route ends.
 
This might be something we can change but it isn't necessarily a bug.

The examples that do work only work because we canonicalise the request URL which is an opt-in thing and not necessarily a thing we do as standard.

It's also not technically directly related to route filters.

For example, I can link to this thread with a changed title portion:
https://xenforo.com/community/threads/maybe-a-bug.177818/

But when you visit the link it is redirected automatically to:
https://xenforo.com/community/threads/route-filter-for-misc-contact.177818/

That's URL canonicalisation and while it does happen if we opt-in to it for route filtered roues, it isn't exclusively tied to route filters as demonstrated above.

We don't perform URL canonicalisation on the contact page which just means it's something we haven't explicitly opted into there but it isn't necessarily a bug.

Indeed there may be other pages where we haven't opted into it either and those, equally, wouldn't necessarily be considered bugs either but we will give it some thought.
 
This might be something we can change but it isn't necessarily a bug.

The examples that do work only work because we canonicalise the request URL which is an opt-in thing and not necessarily a thing we do as standard.

It's also not technically directly related to route filters.

For example, I can link to this thread with a changed title portion:
https://xenforo.com/community/threads/maybe-a-bug.177818/

But when you visit the link it is redirected automatically to:
https://xenforo.com/community/threads/route-filter-for-misc-contact.177818/

That's URL canonicalisation and while it does happen if we opt-in to it for route filtered roues, it isn't exclusively tied to route filters as demonstrated above.

We don't perform URL canonicalisation on the contact page which just means it's something we haven't explicitly opted into there but it isn't necessarily a bug.

Indeed there may be other pages where we haven't opted into it either and those, equally, wouldn't necessarily be considered bugs either but we will give it some thought.
Thanks for the explanation!
 
Thank you for reporting this issue, it has now been resolved. We are aiming to include any changes that have been made in a future XF release (2.1.8).

Change log:
Do URL canonicalization on the contact page and ensure that we link to misc/contact consistently (no trailing slash).
There may be a delay before changes are rolled out to the XenForo Community.
 
Just to clarify that we've applied it here as it may be a commonly-linked to page, but we don't do URL canonicalization in all cases.

The other change is that the correct link is actually misc/contact (rather than misc/contact/). We've changed this. This does have a slight change to any route filter, though it shouldn't break the existing route filter you have in place; you would likely want to change the "find route" to not have a trailing slash after you upgrade.
 
Just to clarify that we've applied it here as it may be a commonly-linked to page, but we don't do URL canonicalization in all cases.

The other change is that the correct link is actually misc/contact (rather than misc/contact/). We've changed this. This does have a slight change to any route filter, though it shouldn't break the existing route filter you have in place; you would likely want to change the "find route" to not have a trailing slash after you upgrade.

Does not having a trailing slash for "find route" apply to all route filters or only for contact? It seem to work as intended even with the trailing slash for all route filters including contact.

To confirm, I should remove all trailing slash for "find route" for all route filters?
 
Last edited:
You'd generally just make the route filter match the "correct" link. What I was noting was that we incorrectly linked to misc/contact/ in one place (that happens to be the most prominent place). That is very much inconsistent with how we do this style of link elsewhere, so we've changed it to misc/contact in 2.1.8.

So ideally, you'd change this particular route filter -- solely because we adjusted the link in question.

In our tests the old value in a route filter didn't break anything -- it just meant that you could end up with trailing slash where you might've expected it (or a possibly a double slash).
 
Top Bottom