Support Forums

Redirect homepage

Hi there, is it possible to redirect the homepage ("/") ?
Tried adding a redirect for “/” in netlify.toml but it seems to redirect everything and therefore prevents other static pages from being served.

And what is the best way to redirect anything in a folder other than 2 specific paths?
Eg: Serve /club/uk and club/us from the static build, but redirect /club/any-other-page

Using NextJS if that has any bearing on this.

Many thanks :slight_smile:

Hi @George_A

You can redirect the homepage (/) a any other path (e.g. /home) using a redirect but will need to use the force option as content exists on the original path (see Redirects & Rewrites Syntax for the Netlify configuration file.)

If you wish to have /clubs/uk and /clubs/us served by the redirect (mentioned above) then you can use Redirect by country or language (see previous link also which contains an example of this in the netlify.toml.)

Hope this gives you something to work with.