Answers for "url redirect to www"

0

redirect htaccess non www to www

RewriteEngine On
RewriteCond %{HTTP_HOST} !^www.
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]
Posted by: Guest on April-14-2020
0

How to redirect non-www URLs to www

RewriteEngine On
RewriteCond %{HTTP_HOST} ^yourdomain.com [NC]
RewriteRule ^(.*)$ http://www.yourdomain.com/$1 [L,R=301]
Posted by: Guest on December-26-2019

Browse Popular Code Answers by Language