Redirect http to https and www

To forward a website to use both www. and https:// use the following in an .htaccess file:

RewriteCond %{HTTPS} off
RewriteRule .* https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
RewriteCond %{HTTP_HOST} !^www\.
RewriteRule .* https://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]


If that code doesn't work please try the following...


RewriteEngine On
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteRule ^(.*) https://www.%{SERVER_NAME}%{REQUEST_URI} [L,R=301]
RewriteCond %{HTTPS} off
RewriteRule ^(.*) https://%{SERVER_NAME}%{REQUEST_URI} [L,R=301]

  • 4 Users Found This Useful

Was this answer helpful?

Related Articles

Domain Slamming - Beware

There are several companies out there using a predatory practice of attempting to have you renew...

Can I setup SSL on my account?

Yes, you can purchase a secure certificate through us so you can use SSL. You can also give us...

I updated my site but I still see old pages

Make sure your files are indeed updated by checking the file time stamps. Also, you may want to...

Adding a Facebook Button

Facebook has a wonderful page on adding a Facebook image to your website complete with...

How can I change the default page / document?

Create a .htaccess file, include the below information into it and upload it to the public_html...