{"id":286,"date":"2025-10-18T18:24:16","date_gmt":"2025-10-18T17:24:16","guid":{"rendered":"https:\/\/hostcreed.com\/blog\/?p=286"},"modified":"2026-01-19T07:12:16","modified_gmt":"2026-01-19T06:12:16","slug":"how-to-force-https-using-htaccess","status":"publish","type":"post","link":"https:\/\/hostcreed.com\/blog\/how-to-force-https-using-htaccess\/","title":{"rendered":"How to force HTTPS using .htaccess?"},"content":{"rendered":"<p>Sometimes, even after installing an SSL Certificate on your domain, it does not automatically redirect you to the https version of your website. In that case, we need to force SSL. Let&#8217;s see how we can do it <span style=\"color: #ff0000;\"><strong>using some simple code in our website&#8217;s .htaccess file.\u00a0<\/strong><\/span><\/p>\n<p>Here is the Force SSL \/ ALWAYS ON HTTPS code for any Apache server-based website:<\/p>\n<div class=\"\"><\/div>\n<div class=\"\"><code>RewriteEngine On<br \/>\nRewriteCond %{HTTPS} off<br \/>\nRewriteRule ^(.*)$ https:\/\/%{HTTP_HOST}%{REQUEST_URI} [L,R=301]<\/code><\/p>\n<p>Just copy those 3 lines carefully and paste them to the very top of your .htaccess file. If you don&#8217;t see an .htaccess file, you either need to turn on show hidden files or manually create it. And then simply save it. Done! Now visit your website to ensure it&#8217;s working.<\/p><\/div>\n","protected":false},"excerpt":{"rendered":"<p>Sometimes, even after installing an SSL Certificate on your domain, it does not automatically redirect you &hellip; <a title=\"How to force HTTPS using .htaccess?\" class=\"hm-read-more\" href=\"https:\/\/hostcreed.com\/blog\/how-to-force-https-using-htaccess\/\"><span class=\"screen-reader-text\">How to force HTTPS using .htaccess?<\/span>Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":287,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[67],"tags":[],"class_list":["post-286","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-hosting-tutorials"],"_links":{"self":[{"href":"https:\/\/hostcreed.com\/blog\/wp-json\/wp\/v2\/posts\/286","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/hostcreed.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/hostcreed.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/hostcreed.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/hostcreed.com\/blog\/wp-json\/wp\/v2\/comments?post=286"}],"version-history":[{"count":2,"href":"https:\/\/hostcreed.com\/blog\/wp-json\/wp\/v2\/posts\/286\/revisions"}],"predecessor-version":[{"id":289,"href":"https:\/\/hostcreed.com\/blog\/wp-json\/wp\/v2\/posts\/286\/revisions\/289"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/hostcreed.com\/blog\/wp-json\/wp\/v2\/media\/287"}],"wp:attachment":[{"href":"https:\/\/hostcreed.com\/blog\/wp-json\/wp\/v2\/media?parent=286"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/hostcreed.com\/blog\/wp-json\/wp\/v2\/categories?post=286"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/hostcreed.com\/blog\/wp-json\/wp\/v2\/tags?post=286"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}