Logo

Our offices

29 Minikahada Trail

Pinehurst, NC 28374

(925) 330-8798

Reach us

support@catholicwebhosting.com

Mon - Fri: 8am - 6pm

24/7 Emergency Support

Back to blog
Uncategorized

Force SSL on your website via .htaccess file

Need to force SSL on your website? We have you covered! You just need to modify the .htaccess via the code editor built into the cPanel file manager system. All you have to do...

AA

Atlante Avila

Founder, Catholic Web Hosting

Need to force SSL on your website? We have you covered! You just need to modify the .htaccess via the code editor built into the cPanel file manager system.

All you have to do to force SSL on your website is to add these lines to the beginning of the .htaccess file:

RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

Forcing Specific Pages

You can target specific pages only. Simply edit the .htaccess file

RewriteEngine On
RewriteCond %{HTTPS} off
RewriteCond %{REQUEST_URI} /[SSL Requested page]/
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R,L]

Click the Save Changes button towards the top right corner of your screen. Check your website to ensure it is functioning as expected.

If that doesn't work, you can try using this instead. Just be sure to replace example.com with your domain name:

RewriteEngine On
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://example.com/$1 [R,L]

Note, there are plenty of ways to do this with WordPress via the plugins repository. Simply search for SSL: WordPress.org SSL Search We don't want to recommend one over the other, but we like Really Simple SSL. Also, it should go without saying but you will need to have an SSL certificate to get this working properly on your website. Need one of those? We offer a low-cost solution starting at only $13/year: Drummer Boy Hosting SSL Certificates

Please be sure to reach out via chat/support tickets if you need assistance with this! We'll be glad to help you force SSL on your website!