http-to-https-with-htaccess

How do I Force my Website to use SSL?

Last modified: February 20, 2019 and is filed under Hosting

What is htaccess ?

htaccess is a configuration file for use on web servers running the Apache Web Server software.

Forcing all website traffic to use HTTPS

Use the following code in your .htaccess file

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

Forcing a specific domain to use HTTPS

RewriteEngine On 
RewriteCond %{HTTP_HOST} ^abcd\.com [NC]
RewriteCond %{SERVER_PORT} 80 
RewriteRule ^(.*)$ https://www.xyz.com/$1 [R,L]

 

Common htaccess Rules

Tags: ,

supercharge your online presence today!

We understand all aspects of internet strategy but focus on design, development, and digital marketing. We create high-quality custom solutions at affordable prices.

+ 91 9745320424 mail@arulmjoseph.com

arul joseph

Arul M Joseph, a freelance web designer and developer based in Kerala, leverages over 12 years of experience to create stunning, SEO-friendly, and tailored websites for businesses of all sizes, from startups to multinational corporations.