Home
Support Forums

Redirect from / (root) to /en

Hi everyone,

we are currently working on an application where the requirement is, that the default url should always be the /en/ directory.

We’ve created some other redirects already and those do work. The only one that does not work is the one from / to /en.

Our _redirects file looks something like this. The redirects for the other languages are in place, so they do not match the last rule (/* /en/)

# redirects in all languages to make sure the last redirect only redirects english pages
########################################################################################################################

/fr/*       /fr/:splat
/pt-br/*    /pt-br/:splat
/es/*       /es/:splat
/de/*       /de/:splat
/*          /en/:splat

I would really appreciate your help on this.

Thanks,
Florian

Hi @florian,

You’d need to change the rule to: /* /en/:splat 301!