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

15 Best NDIS Website Design Examples & Best Practices (2026 Guide)

Quick Summary Choosing the right NDIS website design is about much more than appearance. A…

3 days ago

Shopify SEO & AI Search Visibility: The Complete Guide to Ranking Your Shopify Store in Google and AI Search (2026)

Quick Summary Optimizing a Shopify store in 2026 is no longer just about ranking on…

2 weeks ago

Cloudflare Settings Every Site Owner Should Know (2026)

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

4 weeks 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…

1 month 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…

1 month 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…

1 month ago