Categories
4
Abuse and Security
12 Advanced Users
4 Cloud Hosting Basic Questions
6 CloudFlare
14 cPanel
11 Domain Names
12 Email
1 FFmpeg
2 Free Website Transfer
1 Free Website Transfer
3 FTP Basics
3 ID Protection / Domain Privacy
4 MySQL Basics
1 Name Servers (DNS)
1 PHP
12 Pre Sales Questions
8 Reseller Hosting
2 RV Site Builder
13 Sales & Billing
9 Shared Hosting
1 Softaculous
3 SSH
3 SSL Certificates
8 Troubleshooting
4 VPS and Dedicated Servers
1 Website Transfer Service
1 WordPress
Categories
Redirect to SSL with .htaccess Print
- 0
Once you have purchased an SSL certificate for your website you can redirect your site to connect to the https version by creating a .htaccess file and placing it in your public_html folder.
In the .htaccess file add the following and replace the domain with your actual domain name:
#If the page is NOT secure, and the request URI is supposed to be a secure page, then redirect to a secure page
RewriteCond %{SERVER_PORT} 80 [OR]
RewriteCond %{HTTPS} !on
RewriteRule (.*) https://www.domain.com/$1 [R=permanent,L,NC]
RewriteCond %{SERVER_PORT} 80 [OR]
RewriteCond %{HTTPS} !on
RewriteRule (.*) https://www.domain.com/$1 [R=permanent,L,NC]