jeudi 24 mars 2016

.htaccess - Force www. throws ERR_TOO_MANY_REDIRECTS

I am trying to force the www version of my site through the .htaccess file, but it throws me an ERR_TOO_MANY_REDIRECTS error. Can you help me?

.htaccess:

RewriteBase /

#Errors
ErrorDocument 403 /error.php
ErrorDocument 404 /404.php
ErrorDocument 405 /error.php
ErrorDocument 408 /error.php
ErrorDocument 500 /error.php
ErrorDocument 502 /error.php
ErrorDocument 504 /error.php

RewriteEngine On
#Access .php
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^\.]+)$ $1.php [NC,L]

#Redirect to www
RewriteCond %{HTTP_HOST} !^www\.
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]

Thank you.




Aucun commentaire:

Enregistrer un commentaire