{"id":252,"date":"2011-06-06T19:08:39","date_gmt":"2011-06-06T19:08:39","guid":{"rendered":"http:\/\/www.sitekickr.com\/blog\/?p=252"},"modified":"2011-06-06T19:08:39","modified_gmt":"2011-06-06T19:08:39","slug":"mod-rewrite-w-http-authentication","status":"publish","type":"post","link":"https:\/\/www.sitekickr.com\/blog\/mod-rewrite-w-http-authentication\/","title":{"rendered":"Mod Rewrite w\/ HTTP Authentication"},"content":{"rendered":"<p>Putting a site behind HTTP Authentication is a pretty simple task, but when your site is being served by another application server &#8211; let&#39;s say Zope (Plone) for example, the method isn&#39;t as obvious.<\/p>\n<p>The example VirtualHost stanza below should help:<\/p>\n<p><code>&lt;VirtualHost *:80&gt;<br \/>\n\t&nbsp; ServerName www.mysite.com<br \/>\n\t&nbsp; &lt;Location \/&gt;<br \/>\n\t&nbsp; AuthType Basic<br \/>\n\t&nbsp; AuthName &quot;Login Here&quot;<br \/>\n\t&nbsp; AuthUserFile \/var\/www\/html\/passwords&nbsp;&nbsp; # the password file created with htpasswd<br \/>\n\t&nbsp; Require user <em><strong>some_user_name<\/strong><\/em><br \/>\n\t&nbsp; &lt;\/Location&gt;<br \/>\n\t&nbsp; RewriteEngine On<br \/>\n\t&nbsp; RewriteRule ^\/(.*) http:\/\/127.0.0.1:8080\/VirtualHostBase\/http\/%{HTTP_HOST}:80\/my-plone-site.com\/VirtualHostRoot\/$1 [L,P]<br \/>\n\t&lt;\/VirtualHost&gt;<\/code><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Putting a site behind HTTP Authentication is a pretty simple task, but when your site is being served by another application server &#8211; let&#39;s say&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"amp_status":""},"categories":[41],"tags":[92],"_links":{"self":[{"href":"https:\/\/www.sitekickr.com\/blog\/wp-json\/wp\/v2\/posts\/252"}],"collection":[{"href":"https:\/\/www.sitekickr.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.sitekickr.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.sitekickr.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.sitekickr.com\/blog\/wp-json\/wp\/v2\/comments?post=252"}],"version-history":[{"count":1,"href":"https:\/\/www.sitekickr.com\/blog\/wp-json\/wp\/v2\/posts\/252\/revisions"}],"predecessor-version":[{"id":253,"href":"https:\/\/www.sitekickr.com\/blog\/wp-json\/wp\/v2\/posts\/252\/revisions\/253"}],"wp:attachment":[{"href":"https:\/\/www.sitekickr.com\/blog\/wp-json\/wp\/v2\/media?parent=252"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.sitekickr.com\/blog\/wp-json\/wp\/v2\/categories?post=252"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.sitekickr.com\/blog\/wp-json\/wp\/v2\/tags?post=252"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}