XF 2.3 Route Filter CASE structure

MapleOne

Well-known member
On our website users get a free market page which is tied to their user name.

So user JimJones

gets a marketpage address: domain.com/market/JimJones

The problem I am having is we capitalize user names like JimJones

Then the route filter only works as domain.com/market/JimJones or domain.com/market/jimjones and not both.

Is there any way to make the route filter NOT case sensitive so someone could type jimjones or JimJones at the end of the address?
 
I think you have to use the member ID number and not the user name. Look under the route for members and you will get what is used for it. It is something like int:<member_id> or something like that. Sorry, not at home so I can't look what it is.
 
I'm on cloud so no dev mode :(
You can install addons to it right?

Set up a web server-level redirect (e.g., in for Apache or ) that detects lowercase versions and redirects to the properly cased version.
Apache config:
RewriteEngine On
RewriteCond %{REQUEST_URI} ^/market/([a-z]+)$
RewriteRule ^market/(.*)$ /market/${ucfirst:$1} [R=301,L]
This is a simplistic example—you’d need to match against actual usernames in your database to get the correct casing.

Writing a custom route listener or controller logic should help.
 
Last edited:
i posted this last year to another user, no idea if they ever implemented it... oh wait, that was you :D

did you ever try this?
 
i posted this last year to another user, no idea if they ever implemented it

There is no access on cloud to do that kind of stuff
 
Back
Top Bottom