How to make a 301 redirect from a folder URL to an unique page URL?

Hi there !

I’m having a hard time finding how to integrate a 301 redirect of a folder URL to an unique page URL.

Whenever I’m trying to integrate it within the “301 redirects” section in the settings, the “/” at the end of my folder URL just disappear and act like an unique page URL.

Here is what I want to integrate :

Here is what I’m getting stuck with whenever I click “add redirect path”:
image

I’ve seen on some forums that in that case for the “/” to be taken into account we must add a “$” at the end of the expression. However, in Webflow it just doesn’t work since Webflow won’t allow non alphanumerical caracters.

So I was wondering how to cope with it.
(Even ChatGPT didn’t succeed at giving me the solution haha :joy:)

Thanks in advance for your help ! :pray:

In Webflow ( and many modern CMS’s ), there is no concept of a “folder url”.
Every URL points to a specific page, and folders just add a pre-segment to the URL primarily for organizational purposes.

Think of

/cas-dusage/qualitie-de-vie-au-travalt and
/cas-dusage/qualitie-de-vie-au-travalt/

as the same page in Webflow.

If your original site actually had those two URLs return different content, your best approach is probably to handle the redirection with your DNS provider, e.g. we use Cloudflare’s DNS rules for this.

It’s possible you could make this work using Webflow’s wildcards, because they are matched and processed a bit differently. In your case, I might try;

/cas-dusage/qualitie-de-vie-au-travalt/(.*)/expertised/qualitie-de-vie-au-travalt/

Just to see if it picks up the /. You may also be able to add a second entry that explicitly maps
the non-/ url to itself for exact matching;

/cas-dusage/qualitie-de-vie-au-travalt/cas-dusage/qualitie-de-vie-au-travalt

It’s a bit hacky, but it could let you control the exact route-matching you want.

2 Likes

Thanks a lot for your reply and your help !

I tried with Webflows wildcards and ended up with this :

So the / sticks ! Hopefully I won’t have a redirection chain problem anymore !

1 Like