How To Force SSL On All Pages In .htaccess File
If you are using assistive technology and are unable to read any part of the HostMonster website, or otherwise have difficulties using the HostMonster website, please call 866-573-HOST and our customer service team will assist you.
Skip to main content

HostMonster Web Hosting Help

How To Force SSL On All Pages In .htaccess File

You can force all of your pages to use HTTPS. To do this you will need to modify your .htaccess file.

Using the Code Editor in the File Manager, add these lines to the beginning of the .htaccess file.

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



Was this resource helpful?

Did this resolve your issue?


Please add any other comments or suggestions about this content:





Recommended Help Content

This article will show a way to protect specific pages of your website with SSL. This may have benefits for SEO and can be used on pages that contain forms, shopping carts or any other page where users might enter sensitive information.
Knowledgebase Article 122,624 views tags: htaccess pages specific ssl

Explains how to edit the .htaccess
Knowledgebase Article 371,268 views tags: htaccess

How to use a WildCard SSL Certificate
Knowledgebase Article 225,307 views tags: htaccess reseller ssl subdomain subfolder wildcard

Related Help Content

What is the .htaccess file and where can I find more information?
Knowledgebase Article 2,084,102 views tags: htaccess tips tricks

How do I perform a URL redirect/rewrite using the .htaccess file?
Knowledgebase Article 1,938,080 views tags: htaccess redirect rewrite url

This article explains error pages and how they can be customized.
Knowledgebase Article 321,327 views tags: customize pages

When I try to log into my OSCommerce shopping cart using https://secure.HostMonster.com/~username url, my shopping cart isn't the same. It is as though I have 2 carts, one for HTTP (unsecure) an
Knowledgebase Article 199,362 views tags: commerce cookie oscommerce ssl

How do I use the free shared SSL Certificate?
Knowledgebase Article 947,218 views tags: activate certificate install path shared ssl

How to run CGI scripts for Addon domains.
Knowledgebase Article 234,121 views tags: cgi htaccess

Where do I get a copy of the site seal for my SSL I purchased through HostMonster?
Knowledgebase Article 375,312 views tags: cert image logo seal secure ssl

How to add a new SSL certificate for your different WM services.
Knowledgebase Article 157,989 views tags: ssl whm

This site utilizes JavaScript to function correctly. Looks like it's disabled on your browser. Please enable it for your best experience.

For instructions on enabling JavaScript, click here