How to redirect your non www site to www

  Print
To perform a redirection, you will have to do it via the .htaccess file and place it in the directory it is being run.

RewriteEngine On
RewriteCond %{HTTP_HOST} ^yourdomain.com [NC]
RewriteRule ^(.*)$ http://www.yourdomain.com/$1 [L,R=301]

and if you want to to redirect to https

RewriteEngine On
RewriteCond %{HTTP_HOST} ^yourdomain.com [NC]
RewriteRule ^(.*)$ https://www.yourdomain.com/$1 [L,R=301]

0 out of 0 people found this article useful.

Related Articles

Login

 
Forgot password?
Register now