{"id":1709,"date":"2017-09-01T09:48:08","date_gmt":"2017-09-01T13:48:08","guid":{"rendered":"https:\/\/easy-admin.ca\/?p=1709"},"modified":"2017-09-01T09:49:10","modified_gmt":"2017-09-01T13:49:10","slug":"redirect-http-to-https-in-htaccess","status":"publish","type":"post","link":"https:\/\/easy-admin.ca\/index.php\/2017\/09\/01\/redirect-http-to-https-in-htaccess\/","title":{"rendered":"Redirect HTTP to HTTPS in .htaccess"},"content":{"rendered":"<p>If you want to redirect HTTP to HTTPS and want to add www with each URL, use the htaccess below:<\/p>\n<pre><code>RewriteEngine On\r\nRewriteCond %{HTTPS} off\r\nRewriteRule (.*) https:\/\/%{HTTP_HOST}%{REQUEST_URI} [R,L]\r\nRewriteCond %{HTTP_HOST} !^www\\.\r\nRewriteRule ^(.*)$ https:\/\/www.%{HTTP_HOST}\/$1 [R=301,L] <\/code><\/pre>\n<p>It will first redirect HTTP to HTTPS and then it will redirect to https:\/\/www<\/p>\n<p>\ud83d\ude09<\/p>\n","protected":false},"excerpt":{"rendered":"<p>If you want to redirect HTTP to HTTPS and want to add www with each URL, use the htaccess below: RewriteEngine On RewriteCond %{HTTPS} off RewriteRule (.*) https:\/\/%{HTTP_HOST}%{REQUEST_URI} [R,L] RewriteCond %{HTTP_HOST} !^www\\. RewriteRule ^(.*)$ https:\/\/www.%{HTTP_HOST}\/$1 [R=301,L] It will first redirect HTTP to HTTPS and then it will redirect to https:\/\/www \ud83d\ude09<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-1709","post","type-post","status-publish","format-standard","hentry","category-general"],"_links":{"self":[{"href":"https:\/\/easy-admin.ca\/index.php\/wp-json\/wp\/v2\/posts\/1709","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/easy-admin.ca\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/easy-admin.ca\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/easy-admin.ca\/index.php\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/easy-admin.ca\/index.php\/wp-json\/wp\/v2\/comments?post=1709"}],"version-history":[{"count":0,"href":"https:\/\/easy-admin.ca\/index.php\/wp-json\/wp\/v2\/posts\/1709\/revisions"}],"wp:attachment":[{"href":"https:\/\/easy-admin.ca\/index.php\/wp-json\/wp\/v2\/media?parent=1709"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/easy-admin.ca\/index.php\/wp-json\/wp\/v2\/categories?post=1709"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/easy-admin.ca\/index.php\/wp-json\/wp\/v2\/tags?post=1709"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}