{"id":26,"date":"2005-12-12T19:34:44","date_gmt":"2005-12-12T17:34:44","guid":{"rendered":"https:\/\/www.dont-panic.cc\/capi\/?p=26"},"modified":"2007-10-03T15:32:34","modified_gmt":"2007-10-03T14:32:34","slug":"apache-force-ssl-for-a-directory-using-htaccess-and-mod_rewrite","status":"publish","type":"post","link":"https:\/\/www.dont-panic.cc\/capi\/2005\/12\/12\/apache-force-ssl-for-a-directory-using-htaccess-and-mod_rewrite\/","title":{"rendered":"Apache: Force SSL for a Directory Using .htaccess and mod_rewrite"},"content":{"rendered":"<p>To force SSL on a given directory using .htaccess, use the following code. It requires mod_rewrite enabled in Apache. Adjust the path in the RewriteRule to match the full qualified URL of the HTTPS-domain.<\/p>\n<blockquote><p><code><br \/>\nRewriteEngine On<br \/>\nRewriteCond %{SERVER_PORT} !443<br \/>\nRewriteRule ^(.*)$ https:\/\/www.example.com\/$1 [R=301,L]<br \/>\n<\/code><\/p><\/blockquote>\n","protected":false},"excerpt":{"rendered":"<p>To force SSL on a given directory using .htaccess, use the following code. It requires mod_rewrite enabled in Apache. Adjust the path in the RewriteRule to match the full qualified URL of the HTTPS-domain. RewriteEngine On RewriteCond %{SERVER_PORT} !443 RewriteRule ^(.*)$ https:\/\/www.example.com\/$1 [R=301,L]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3,7,10],"tags":[141,142,36,143,227],"class_list":["post-26","post","type-post","status-publish","format-standard","hentry","category-internet","category-security","category-sysadmin","tag-apache","tag-config","tag-howto","tag-mod_rewrite","tag-security"],"_links":{"self":[{"href":"https:\/\/www.dont-panic.cc\/capi\/wp-json\/wp\/v2\/posts\/26","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.dont-panic.cc\/capi\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.dont-panic.cc\/capi\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.dont-panic.cc\/capi\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.dont-panic.cc\/capi\/wp-json\/wp\/v2\/comments?post=26"}],"version-history":[{"count":0,"href":"https:\/\/www.dont-panic.cc\/capi\/wp-json\/wp\/v2\/posts\/26\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.dont-panic.cc\/capi\/wp-json\/wp\/v2\/media?parent=26"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.dont-panic.cc\/capi\/wp-json\/wp\/v2\/categories?post=26"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.dont-panic.cc\/capi\/wp-json\/wp\/v2\/tags?post=26"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}