Redirect http:// to https://
General Post, Tutorials April 10th, 2007I have been looking online for some time to redirect http:// URL to https:// automatically. So when user request for cripperz.com it will be redirected to https://cripperz.com. After several tries this is what i have came up with :
1 2 3 | RewriteEngine On RewriteCond %{HTTPS} off RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} |
- Open your preferred editor
- Copy-paste text and save as . htaccess
- Upload the file to your root directory (where your main index file is located)
- Lastly, CHMOD the file to 775 or 777
You have got yourself a redirection ![]()
~Happy Coding~
November 25th, 2007 at 10:00 pm
Hi Mate
This doesnt seem to be working for me
ny idea!!
June 4th, 2008 at 7:44 pm
above code is also dependant on server side settings. Of which whether your hoster provide and enable https port 443 on their apache. So Ahmad, that might be the reason yours is not working. Also take note that you would need a valid for SSL pages.
cheers all.