
You can easily redirect your visitor form http version of your website to https version of your website. This can be done using apache mod_rewrite. This technique makes sure that the visitor your website always goes to the https version of the website or part of your website you have implemented SSL for your website.
This method is better than SSLRequireSSL because people often forget to write https in the url .
Before setting up to redirect your website form http to https please through the following check-list.
- Ensure the SSL certificate is already install on your website and your website is accessible at https://www.yoursite.com
- Make sure mod_rewrite is enabled in Apache
- Create a .htaccess file in your web server root directory, and write the following code on it.
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{SERVER_NAME}/ [R,L]