I was looking in vain for a feature and hope you can help me with it.
I’m coming from WordPress and there, I have WordPress Multilanguage installed with the language name added as a parameter in the URL, like mysite.com/?lang=de instead of mysite.com/de/.
Is it possible to have this feature in Hugo?
If I were to transition fully to Hugo, I’d like that to be the same or at least find a way to redirect properly (which I also don’t know how to do).
Thanks in advance!
You can do it either from the same domain like mysite.com/en, mysite.com/de, or, use different domains like mysite.com for English, mysite.de for German. But not with url params.
Redirecting will be the way to go, and it depends upon where you are hosting; more precisely, the webserver itself will dictate the method. E.g. if Apache, you could redirect using an
Thank you for your answer!
That’s a bummer though, I’d hope they’d be a way. Shall I add it as a feature request or is there another reason other than low priority why it’s not implemented yet?
How are you hosting your Hugo site? With Netlify you can make a redirect for something like this. https://www.netlify.com/docs/redirects/#query-params
I am not one of the devs, but that method is CMS-ish in that you’re telling the server “do something in reaction to this URL”, whereas, Hugo is static.
That requires software that works with your webserver to return results. Hugo makes static web pages. Two different creatures.
As you figure out how to craft your redirects for you web server of choice, you’ll have an opportunity to learn how it parses those requests.
I see. Thank you very much guys!
I’m still getting used to thinking “static”.