Mobile app version of vmapp.org
Login or Join
Shelley277

: .htaccess language detection, redirect and friendly URLs I'm having problems with my .htaccess file. RewriteEngine On RewriteCond %{HTTP:Accept-Language} (fr) [NC] RewriteRule .* http://www.example.com/frans

@Shelley277

Posted in: #Detection #Htaccess #Language #Redirects #Url

I'm having problems with my .htaccess file.

RewriteEngine On
RewriteCond %{HTTP:Accept-Language} (fr) [NC]
RewriteRule .* www.example.com/frans [R,L]
RewriteRule .* www.example.com/nederlands [R,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}.html -f
RewriteRule ^(.+)$ .html [L,QSA]
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9} /.*.html HTTP/
RewriteRule ^(.*).html$ / [R=301,L]


Can anyone please help?

I want it to detect the browser language of the client, then redirect French to /frans, and all other languages to /nederlands.

Also I want to show the URLs without .html or .php at the end, so clean URLs.

10% popularity Vote Up Vote Down


Login to follow query

More posts by @Shelley277

0 Comments

Sorted by latest first Latest Oldest Best

Back to top | Use Dark Theme