Skip to content
Grav 2.0 is officially stable. Read the announcement →
Archive

Redirect to /{lang}/route/ using trailing slash

Started by Muut Archive 10 years ago · 2 replies · 555 views
10 years ago

Hi,

I found that redirect_trailing_slash: false (which is really odd) redirects /grav to /grav/en/, which is what I want.

I would like this to work for all the routes I have, for example:

  • /grav/premium should redirect to /grav/en/premium/ - (current redirect is: /grav/en/premium)
  • /grav/en/premium should redirect to /grav/en/premium/ - (current redirect is: /grav/en/premium)

Is it possible?

Thanks

10 years ago

I think redirect_trailing_slash actually works ONLY if it's set to true, so it would redirect a URL with a trailing slash to the URL without it.

If set to false, nothing happens. It's not working at the opposite (it's not going to redirect non-trailing to trailing slash)

The fact that multilanguage adds en/ to the home page, but not to inner pages, is another thing AFAIK, but not related to redirect_trailing_slash.

10 years ago

@flavio but when I do redirect_trailing_slash: true, then /grav redirect to /grav/en... which is weird. I need to setup it back to false in order to have /grav/en/. I'm using Grav v1.1.1

Suggested topics

Topic Participants Replies Views Activity
Archive · by Deleted User, 9 years ago
0 1366 9 years ago
Archive · by Muut Archive, 9 years ago
2 940 9 years ago
Archive · by Muut Archive, 9 years ago
2 4069 9 years ago
Archive · by Muut Archive, 9 years ago
1 2960 9 years ago
Archive · by Muut Archive, 9 years ago
3 1125 9 years ago