There was a problem loading the comments.

How to redirect my domain from non-www to www?

Support Portal  »  Knowledgebase  »  Viewing Article

  Print

If you wish to redirect your domain from non-www to www, place the following code to your .htaccess file, which you can find from your domain's root directory:

 

RewriteEngine On
RewriteCond %{HTTP_HOST} !^www\.
RewriteRule ^(.*)$ https://www.your-domain-goes-here.com/$1 [R=301,L]

 

If you wish to redirect your domain from www to non-www, place the following code to your .htaccess file:

 

RewriteEngine On
RewriteCond %{HTTP_HOST} ^www\.
RewriteRule ^(.*)$ https://your-domain-goes-here.com/$1 [R=301,L]

 

If RewriteEngine On already exists in your .htaccess file, you may remove it.

 

This example uses https:// protocol. If your domain does not use https, change it to http://

 

 

 

Redirecting using domain redirects

 

If you don't wish to edit your .htaccess file, you can add a non-www to www or vice versa redirect from the PBN dashboard.

Just click on "Actions" > "Misc" > "Domain Redirects" and turn the redirect you prefer either "Redirect to "WWW" - on (or) "Redirect to "non-WWW"  - on. 

 

You can use either the htaccess method or domain redirects method to set redirects for your domain.

 


Share via
Did you find this article useful?  

Related Articles

© Priority Prospect