I'm looking to use the language switch in our website using mod rewrite. Instead of showing:
https://www.website.com/rest/of/my-site?lang=it
https://www.website.com/en/rest/of/my-site
The problems comes here. A Our current mod rewrite configuration:
# General rewrites
RewriteRule -p([0-9]+)\.html$ index.php?module=page&id=$1&%{QUERY_STRING} [L]
RewriteRule (news|nieuws)/(.*)\.html$ index.php?module=news&url_raw=$2&%{QUERY_STRING} [L]
RewriteRule (.*)\.html$ index.php?module=page&url_raw=$1&%{QUERY_STRING} [L]
#rewriteRule contact(/|)$ index.php?module=contact&%{QUERY_STRING} [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule (.*)$ index.php?module=page&url_raw=$1&%{QUERY_STRING} [L]
B Mod rewrite and the PHP snippet When the mod rewrite is working the user should be able to switch from
- website.com/en/rest/of/my-site
- website.com/it/rest/of/my-site
Instead of
- website.com/en/rest/of/my-site?lang=it
I have tried several options (language parameter rewrite with mod_rewrite) but I do not come far enough with it.