|Knowledgebase Home | Glossary | Favorites | Login|
|Apache Redirect HTTP to HTTPS using mod_rewrite|
Apache’s mod_rewrite makes it easy to require SSL to be used on your site and to gently redirect users who forget to add the https when typing the URL. Using Apache to redirect http to https will make sure that your site (or a part of it) will only be accessed by your customers using SSL. This is better than using SSLRequireSSL because users often forget to type in the https and will be automatically redirected.
Before you can set up an Apache redirect from http to https, you will need to do the following:
Now you just need to edit your httpd.conf file or the file where your virtual host is specified and add these lines to redirect http to https:
In many cases, you can also just add those lines to a file named .htaccess in the folder that you want to redirect http to https.
Now, when a visitor types http://www.yoursite.com/mypage.htm the server will automatically redirect http to https so that they go to https://www.yoursite.com/mypage.htm
Note: You can also redirect a single page from http to http in Apache by using this in your configuration file or .htaccess file:
|No related articles were found.|
|No attachments were found.|
Powered by Mango Certifying Authority