.htaccess - Language redirection with mod_rewrite -
i'm totally clueless when comes mod_rewrite, i'll glad help. want apache redirect homepage according detected country language. php auto-translating in multiple languages , i'm trying avoid multiplying same exact site subdomains , domains because of seo - looks google not advanced yet, giving no other choice.
e.g.
mysite.com to: mysite.com/index.php?lang=nl holland mysite.com/index.php?lang=fr france , no specified country code to: mysite.com/index.php?lang=be mysite.com/?lang=nl wwould fine
i'll happy hear better suggestion. tried following no succes
rewritecond %{http:accept-language} ^nl[nc] rewriterule ^index\.html /index\.php?lang=nl [qsa,nc,l] rewritecond %{http:accept-language} ^fr[nc] rewriterule ^index\.html /index\.php?lang=fr [qsa,nc,l]
i'm getting server error - couldn't find exact case
try with:
rewritecond %{http:accept-language} ^(nl|fr) [nc] rewriterule ^(index\.html)?$ /index.php?lang=%1 [qsa,nc,l] rewriterule ^(index\.html)?$ /index.php?lang=be [qsa,nc,l]
Comments
Post a Comment