{"id":1112,"date":"2018-03-19T11:45:28","date_gmt":"2018-03-19T11:45:28","guid":{"rendered":"http:\/\/www.haxed.me.uk\/?p=1112"},"modified":"2018-03-19T11:45:28","modified_gmt":"2018-03-19T11:45:28","slug":"redirect-http-https","status":"publish","type":"post","link":"https:\/\/haxed.me.uk\/index.php\/2018\/03\/19\/redirect-http-https\/","title":{"rendered":"Redirect HTTP to HTTPS"},"content":{"rendered":"<p>It&#8217;s pretty simple after adding a HTTPS site in apache, to forward your existing HTTP website traffic to HTTPS. There might be reasons why you don&#8217;t forward everything, but in this case today I was asked to forward everything. Here is how I achieved it:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\nRewriteEngine On\r\nRewriteCond %{HTTPS} !=on\r\nRewriteRule ^\/?(.*) https:\/\/%{SERVER_NAME}\/$1 &#x5B;R,L] \r\n<\/pre>\n<p>It could be configured for a specific directory tho <\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\nRewriteEngine On\r\nRewriteCond %{HTTPS} !=on\r\nRewriteRule ^\/?somedir\/(.*) https:\/\/%{SERVER_NAME}\/secure\/$1 &#x5B;R,L] \r\n<\/pre>\n<p>Pretty simple stuff.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>It&#8217;s pretty simple after adding a HTTPS site in apache, to forward your existing HTTP website traffic to HTTPS. There might be reasons why you don&#8217;t forward everything, but in this case today I was asked to forward everything. Here &hellip; <a href=\"https:\/\/haxed.me.uk\/index.php\/2018\/03\/19\/redirect-http-https\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[33,101,120],"tags":[],"class_list":["post-1112","post","type-post","status-publish","format-standard","hentry","category-apache","category-http","category-mod-rewrite"],"_links":{"self":[{"href":"https:\/\/haxed.me.uk\/index.php\/wp-json\/wp\/v2\/posts\/1112","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/haxed.me.uk\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/haxed.me.uk\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/haxed.me.uk\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/haxed.me.uk\/index.php\/wp-json\/wp\/v2\/comments?post=1112"}],"version-history":[{"count":1,"href":"https:\/\/haxed.me.uk\/index.php\/wp-json\/wp\/v2\/posts\/1112\/revisions"}],"predecessor-version":[{"id":1113,"href":"https:\/\/haxed.me.uk\/index.php\/wp-json\/wp\/v2\/posts\/1112\/revisions\/1113"}],"wp:attachment":[{"href":"https:\/\/haxed.me.uk\/index.php\/wp-json\/wp\/v2\/media?parent=1112"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/haxed.me.uk\/index.php\/wp-json\/wp\/v2\/categories?post=1112"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/haxed.me.uk\/index.php\/wp-json\/wp\/v2\/tags?post=1112"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}