{"id":65,"date":"2004-01-21T08:05:38","date_gmt":"2004-01-21T14:05:38","guid":{"rendered":"http:\/\/www.mooreds.com\/wordpress\/?p=65"},"modified":"2004-01-21T08:05:38","modified_gmt":"2004-01-21T14:05:38","slug":"mod_alias-to-the-rescue","status":"publish","type":"post","link":"https:\/\/www.mooreds.com\/wordpress\/archives\/65","title":{"rendered":"mod_alias to the rescue"},"content":{"rendered":"<p>Have you ever wanted to push all the traffic from one host to another?  If you&#8217;re using <a href='http:\/\/httpd.apache.org'>apache<\/a>, it&#8217;s easy.  I needed to have all traffic from a http:\/\/www.foo.com site go to https:\/\/secure.foo.com.  Originally, I was thinking of having a meta header redirect on the index.html page, and creating a custom 404 page that would also do a redirect.<\/p>\n<p>Luckily, some folks corrected me, and showed me an easier way.    <a href='http:\/\/httpd.apache.org\/docs\/mod\/mod_alias.html'>mod_alias<\/a>  (<a href='http:\/\/httpd.apache.org\/docs-2.0\/mod\/mod_alias.html'>ver 2.0<\/a>) can do this easily, and as far as I can tell, transparently.  I just put this line in the virtual server section for www.foo.com:<\/p>\n<p><code>Redirect permanent \/ https:\/\/secure.foo.com\/<\/code><\/p>\n<p>Now, every request for any file from www.foo.com gets routed to secure.foo.com.  And since they share the same docroot, this is exactly what I wanted.<\/p>\n<p>To do this, make sure you have mod_alias available.  It should be either compiled in (you can tell with httpd -l) or a shared library (on unix, usually called mod_alias.so).  You have to make sure to load the shared library; see <a href='http:\/\/httpd.apache.org\/docs\/mod\/mod_so.html#loadmodule'>LoadModule<\/a> and <a href='http:\/\/httpd.apache.org\/docs\/mod\/core.html#addmodule'>AddModule<\/a> for more information.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Have you ever wanted to push all the traffic from one host to another? If you&#8217;re using apache, it&#8217;s easy. I needed to have all traffic from a http:\/\/www.foo.com site [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[],"class_list":["post-65","post","type-post","status-publish","format-standard","hentry","category-technology"],"_links":{"self":[{"href":"https:\/\/www.mooreds.com\/wordpress\/wp-json\/wp\/v2\/posts\/65","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.mooreds.com\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.mooreds.com\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.mooreds.com\/wordpress\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.mooreds.com\/wordpress\/wp-json\/wp\/v2\/comments?post=65"}],"version-history":[{"count":0,"href":"https:\/\/www.mooreds.com\/wordpress\/wp-json\/wp\/v2\/posts\/65\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.mooreds.com\/wordpress\/wp-json\/wp\/v2\/media?parent=65"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.mooreds.com\/wordpress\/wp-json\/wp\/v2\/categories?post=65"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.mooreds.com\/wordpress\/wp-json\/wp\/v2\/tags?post=65"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}