I have a website, say, https://example.com, that runs on LAMP stack (Apache2 rewrite_mod activated) and that I would like to make multilingual.
I don’t want my URLs to contain the language/locale, though — I want to only keep them in the $_GET array. So, when clicking a link with the address https://example.com/dev/en
, I want to see https://example.com/dev/
in the address bar and [lang] => en
in the $_GET array.
Is there a way to do this (with Apache RewriteRules or whatever)?
Here’s how far I’ve got:
RewriteEngine on
RewriteRule ^dev/(w+)$ dev?lang=$1
This does rewrite the /en
but keeps the parameter in the address bar which I don’t want.
Ivan Vetoshkin is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.