www or non www redirection

If you want to redirect your website from non www to www  for example rdpsupport.com
to www.rdpsupport.com. So you need to create .htaccess page under public_html directory.
After that put below code in .htaccess page according to your requirement.

For www redirection 

#Force www: 
#Repalce rdpsupport.com with your domain 
RewriteEngine on 
RewriteCond %{HTTP_HOST} ^rdpsupport.com [NC] 
RewriteRule ^(.*)$ https://www.rdpsupport.com/$1 [L,R=301,NC]

For non www redirection

#Force non-www:
#Replace rdpsupport.com with your domain
RewriteEngine on
RewriteCond %{HTTP_HOST} ^www.rdpsupport.com [NC]
RewriteRule ^(.*)$ https://rdpsupport.com/$1 [L,R=301]

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *