Redirecting urls with a comma

I am trying to redirect a url that contains a comma.

This is the old url: Koulutuspaikka

I tried to replace the comma in the old url in this way: /palvelumme/lean-koulutus/2-uncategorised/322-avoin-koulutus%2C-koulutuspaikka.html and redirect it to: /avoin-koulutus-koulutuspaikka

I tried several options and even wildcards to solve this problem but nothing seems to work. How can i redirect this url in webflow to my right page?

Hi Roland, your encoded comma should work fine.
What is the domain name of your site that you’re trying to implement this on?

Hi Michael,

This is the old domain: Koulutuspaikka

and this is the new domain: https://leansixsigmakoulutus.webflow.io It still only have its webflow.io domain because i can’t put it live yet because of the urls that i can’t redirect at the moment.

The %2C should work fine-

Let’s remove your wildcard one-
/palvelumme/lean-koulutus/2-uncategorised/322-avoin-koulutus(.*)

And fix the other to include your encoded comma;
/palvelumme/lean-koulutus/2-uncategorised/322-avoin-koulutus%2C-koulutuspaikka.html
/avoin-koulutus-koulutuspaikka

And republish.

Let me know when it’s there.

I removed the wildcard one and set the one you suggested. But i already tried that one as first. It should work but doesn’t

Thanks Roland,

Very interesting, Chrome does not automatically url-encode the comma and Webflow doesn’t either, so it’s not matching your redirect.

This works fine-
https://leansixsigmakoulutus.webflow.io/palvelumme/lean-koulutus/2-uncategorised/322-avoin-koulutus%2C-koulutuspaikka.html

But this does not-
https://leansixsigmakoulutus.webflow.io/palvelumme/lean-koulutus/2-uncategorised/322-avoin-koulutus,-koulutuspaikka.html

Even though they’re effectively equivalent.

I wanted to try the non-wildcard approach first since it’s more specific, however this glitch seems to preclude that. Let’s go back to the wildcard one but this time, escape the hyphens like so-

/palvelumme/lean%-koulutus/2%-uncategorised/322%-avoin%-koulutus(.*)
/avoin-koulutus-koulutuspaikka

When you use the (.*) wildcard match, Webflow requires certain characters to be escaped-

Hi Michael,

You are amazing this last one works although that surprises me because i did try that one as well already. But maybe i forgot to delete the previous one and it didn’t work because of that. I will use this technique on all the other comma seperated urls the client has. It should work atleast they don’t get a 404 error this way. Thank you so much for your help.

Thanks Roland, I’m glad it worked.

It’s easy to miss some of the hyphens for escaping, I’ve done it many times- but it may also have been that your browser was caching your previously-defined redirect which Chrome in particular likes to do.

I’m updating my course notes, thanks for sharing this. Interesting problem.