Webmasters Stack Exchange is a question and answer site for pro webmasters. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm having problems with my .htaccess file.

RewriteEngine On
RewriteCond %{HTTP:Accept-Language} (fr) [NC]
RewriteRule .* http://www.example.com/frans [R,L]
RewriteRule .* http://www.example.com/nederlands [R,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}.html -f
RewriteRule ^(.+)$ $1.html [L,QSA]
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /.*\.html\ HTTP/
RewriteRule ^(.*)\.html$ /$1 [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.

share|improve this question

closed as too broad by dan Feb 6 '14 at 0:44

There are either too many possible answers, or good answers would be too long for this format. Please add details to narrow the answer set or to isolate an issue that can be answered in a few paragraphs.If this question can be reworded to fit the rules in the help center, please edit the question.

Please, explain a little bit more what do you exactly want to do. – Zistoloen Jan 27 '14 at 11:56
I think it is clear now. ty – Joeri Jan 27 '14 at 12:46
Removing file extensions like .php can be problematic - see this answer and comments: webmasters.stackexchange.com/questions/52518/… There are many questions here on how to remove .html. You might do better to look at those, and edit your question to be specific to just redirecting based on the language, since it's really too broad otherwise. – dan Jan 27 '14 at 16:02