{"id":857,"date":"2020-05-15T01:02:09","date_gmt":"2020-05-14T19:02:09","guid":{"rendered":"https:\/\/hasibul.info\/blog\/?p=857"},"modified":"2020-05-15T01:22:11","modified_gmt":"2020-05-14T19:22:11","slug":"how-to-force-redirect-http-to-https-using-htaccess","status":"publish","type":"post","link":"https:\/\/hasibul.info\/blog\/2020\/05\/15\/how-to-force-redirect-http-to-https-using-htaccess\/","title":{"rendered":"How to force redirect http to https using .htaccess"},"content":{"rendered":"\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" width=\"1024\" height=\"501\" src=\"https:\/\/hasibul.info\/blog\/wp-content\/uploads\/2020\/05\/force-http-to-https-redirection-htaccess-e1589482664784-1024x501.jpg\" alt=\"how to force http to https redirection htaccess\" class=\"wp-image-858\"\/><\/figure>\n\n\n<p>If you have an SSL certificate installed and would like to force your website to load with https URL &#8211; you may add the following code in the .htaccess file (Linux based hosting):<\/p>\n<blockquote>\n<pre class=\"prebox\">RewriteEngine On\nRewriteCond\u00a0%{HTTPS}\u00a0!=on\nRewriteRule ^(.*)$ https:\/\/%{HTTP_HOST}%{REQUEST_URI} [L,R=301,NE]<\/pre>\n<\/blockquote>\n<p>You need to place the .htaccess file in the home directory of your website.<\/p>\n<p>\u00a0<\/p>","protected":false},"excerpt":{"rendered":"<p>If you have an SSL certificate installed and would like to force your website to load with https URL - you may add the following code in the .htaccess file (Linux based hosting): RewriteEngine On RewriteCond\u00a0%{HTTPS}\u00a0!=on RewriteRule ^(.*)$ https:\/\/%{HTTP_HOST}%{REQUEST_URI} [L,R=301,NE] You need to place the .htaccess file in the home directory of your website. \u00a0<\/p>","protected":false},"author":1,"featured_media":858,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[5,13,18,17,6,12,203],"tags":[],"how-to":[],"_links":{"self":[{"href":"https:\/\/hasibul.info\/blog\/wp-json\/wp\/v2\/posts\/857"}],"collection":[{"href":"https:\/\/hasibul.info\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/hasibul.info\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/hasibul.info\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/hasibul.info\/blog\/wp-json\/wp\/v2\/comments?post=857"}],"version-history":[{"count":0,"href":"https:\/\/hasibul.info\/blog\/wp-json\/wp\/v2\/posts\/857\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/hasibul.info\/blog\/wp-json\/wp\/v2\/media\/858"}],"wp:attachment":[{"href":"https:\/\/hasibul.info\/blog\/wp-json\/wp\/v2\/media?parent=857"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/hasibul.info\/blog\/wp-json\/wp\/v2\/categories?post=857"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/hasibul.info\/blog\/wp-json\/wp\/v2\/tags?post=857"},{"taxonomy":"how-to","embeddable":true,"href":"https:\/\/hasibul.info\/blog\/wp-json\/wp\/v2\/how-to?post=857"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}