Knowledgebase
How do I redirect users to the SSL version of my site?


If you are wanting to automatically redirect users from http://yourdomain.com to https://yourdomain.com, you would need to do that with an .htaccess directive that looks like this:

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

You would put these lines in a file called .htaccess in your public_html directory.
The second line is a "condition" which says for the third line to activate if anyone visits the non-SSL version of your site.
Then the third line redirects them to the SSL version.

If you are using File Manager to edit your files, you may need to click "Settings" and "Show Hidden Files (dotfiles)" if you do not see a file named .htaccess in your public_html folder.

If you are using Wordpress, you will want to first change the WordPress Address and Site Address in your General Settings in the WP Admin to the HTTPS address. Then add the above code to your .htaccess above the standard WordPress .htaccess directives.

If you run into "insecure content" or mixed-content warnings, that means some resources on your page are hardcoded using static URLs that start with http:// rather than relative urls. You just need to go through your site's code or database to find these. You can use View Source in your browser and search for the string "http://" to find the resource that is being accessed over HTTP. If you are using WordPress and have a lot of hard-coded URLs, you can use the plugin Better Search and Replace to update these URLs.


Comments (0)
Help Desk Software by Kayako Resolve