• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Not a bug Subroutes require trailing slashes

Affected version
2.0.0 Beta 4

katsulynx

Well-known member
#1
Whenever you create a nested route, that is part of another route, you're always required to add the trailing slash, or the controller is trying to access the action on the parent controller.

For example if you open up https://xenforo.com/community/account/connected-accounts/, everything works fine, but as soon as you remove the trailing slash, the link breaks (https://xenforo.com/community/account/connected-accounts), as the router tries to access actionConnectedAccounts on the account controller. This is a really confusing behaviour, as inexperienced users likely will not be able to tell (let alone understand) the difference.
 

Kier

XenForo Developer
Staff member
#2
Given that the XF link builder always adds the necessary trailing slash, and regular users aren't in the habit of arbitrarily changing bits of URLs, I don't think that this is really an issue that needs to be addressed.
 

Scharesoft

Active member
#3
I find this also confusing. I personally often navigate through changing the url in the browser. For me this is an unwanted behavior. Here it would be generally useful to have a redirect from the url without a slash to a slash after it.
 

katsulynx

Well-known member
#4
@Kier there are mechanisms like auto-linkers around the web that fail at converting the full url and leave the trailing slash (and also trailing brackets) out of the actual url. Having a broken URL because of that seems kinda unnecessary to me. But if this is classified as "Not a bug", I guess I'll have to manually include the redirect behavior in my addons.
 

katsulynx

Well-known member
#5
I just wanted to add that someone seems to have stumble across this behavior as well, as the Pub\Controller\WhatsNew actually includes permanent redirects for posts & profile posts.