Hosting

How do I Force my Website to use SSL?

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

Arul M Joseph

Arul M Joseph is a certified Shopify Partner and freelance web designer based in Kozhikode, Kerala. Since 2011, he has built 500+ websites for small businesses and eCommerce brands across India, UAE, UK, US, and Australia. His work covers Shopify stores, WordPress websites, WooCommerce stores, and Laravel applications. arulmjoseph.com is a government-registered MSME (Udyam No: UDYAM-KL-08-0062793), verified on GoodFirms and the Shopify Partner Directory.

Share
Published by
Arul M Joseph
Tags: htaccessTech

Recent Posts

Cloudflare Settings Every Site Owner Should Know (2026)

Most people connect Cloudflare to their domain and then do nothing. The default settings protect…

1 week ago

Shiprocket Checkout vs Razorpay Magic Checkout vs GoKwik (2026)

Shiprocket Checkout, Razorpay Magic Checkout, and GoKwik all solve the same problem: slow checkout and…

2 weeks ago

Shopify’s Latest AI Updates Are Changing How Online Stores Get Found

If you've been running a Shopify store the same way you did two or three…

3 weeks ago

The Real Cost of a Slow Website: Optimizing Core Web Vitals for E-commerce

If your online store takes longer than three seconds to load, you aren’t just losing…

3 weeks ago

Website Development Cost in Kerala (2026): What You’ll Actually Pay

The website development cost in Kerala can range from ₹4,000 to over ₹2,00,000 for what…

2 months ago

Canva for Small Business: How to Create, Schedule & Grow on Social Media

Last year, I watched a friend spend INR 500 every single time she needed an…

4 months ago