Auto redirect to www subdomain - .htaccess

RewriteCond %{HTTP_HOST} . RewriteCond %{HTTP_HOST} !^localhost RewriteCond %{HTTP_HOST} !^www\. [NC] RewriteRule ^ http%{ENV:protossl}://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
Redirige automatiquement les visiteurs vers le sous-domaine www. si le visiteur à tenter d'accéder directement au nom de domaine.

Be the first to comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.