In some cases you would want to have your site use SSL (https://) at all times you can do this by using:
1.) Using Htaccess/mod_rewrite. You only need to create a .htaccess file on your home directory and add the codes below:
1 2 3 4 5
The above codes may not work on other Apache/php setup but i’m not sure what’s the exact configuration variable for that.
Anyway, here are my alternatives. Either of them is fine if you’re running http and https on standard ports (http=80, https=443), otherwise change the value to your custom http or https port. Change domain.com to your domain.
1 2 3 4 5 6 7 8 9 10 11
2.) PHP function. If your site use PHP you can redirect the url to SSL/https using this function:
1 2 3 4 5 6 7 8 9
If you are using an application/script wherein you can enter the settings for site url (either from database or config file), it is better to use that settings.
Let me know if you run into issues, maybe i can help. :)