Literal colon in redirect?

I’m thinking of moving a Mediawiki website to Render, and I’d like to set up redirects correctly, so that

http://twelf.org/wiki/User:Rsimmons
and
http://twelf.org/wiki/User:Tom7

go to

and

respectively.

This is hard to do, because a redirect rule /wiki/User:Rsimmons treats “Rsimmons” as the name of a parameter. I was hoping I could replace the redirect with the encoded /wiki/User%3ARsimmons, but this had the same wildcard behavior. Is there anything that can be done at the Render level to redirect a URL with a colon?

Hi Rob,

Have you tried just adding an additional colon to the redirect rule? Maybe something like

Regards,

Matt

With this setup

I get both https://twelf.onrender.com/wiki/User:Rsimmons and https://twelf.onrender.com/wiki/User:Tom7 redirecting to /wiki/user-tom7/, presumably because the first of the two patterns is wildcard matching “/wiki/User” followed by anything that looks like a slug, whether that’s “:Rsimmons” or “:Tom7”. If I switch the order (and switch browsers so that the 302 redirect doesn’t get cached) then I they both redirect to /wiki/user-rsimmons/

Would still be interested in a solution to this if anyone has any ideas. The site is live, and urls like https://twelf.org/wiki/%25assert forward correctly, but I had to use a backup solution where the 404 page looks up the URL in a lookup table to handle the cases where the URL contained a colon, so redirected URLs https://twelf.org/wiki/User:Rsimmons and https://twelf.org/wiki/User:Tom7 can be reached directly by users. A 302 redirect would obviously be better.

Hi Rob,

Would it work to use the placeholder instead of hardcoding the names?

I’m wondering if you use /wiki/User::name as the Source then use the :name as a placeholder in the redirect Destination /wiki/user-:name

Regards,

Matt