Categories
Abuse and Security
4
Advanced Users
11
Cloud Hosting Basic Questions
4
CloudFlare
6
cPanel
13
Domain Names
11
Email
12
FFmpeg
1
Free Website Transfer
2
Free Website Transfer
1
FTP Basics
2
ID Protection / Domain Privacy
3
MySQL Basics
4
Name Servers (DNS)
1
PHP
1
Pre Sales Questions
12
Reseller Hosting
7
Sales & Billing
13
Shared Hosting
9
Softaculous
1
SSH
3
SSL Certificates
3
Troubleshooting
8
VPS and Dedicated Servers
4
Website Transfer Service
1
WordPress
1
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]
Was this answer helpful?
Related Articles
Loading...
Loading...