{"id":315,"date":"2006-02-15T09:37:58","date_gmt":"2006-02-15T15:37:58","guid":{"rendered":"http:\/\/www.mooreds.com\/wordpress\/?p=315"},"modified":"2006-02-15T09:37:58","modified_gmt":"2006-02-15T15:37:58","slug":"mod_alias-vs-mod_proxy-for-xmlhttprequest-proxying","status":"publish","type":"post","link":"https:\/\/www.mooreds.com\/wordpress\/archives\/315","title":{"rendered":"mod_alias vs mod_proxy for XMLHttpRequest proxying"},"content":{"rendered":"<p>If you&#8217;re going to use an apache proxy to <a href='http:\/\/www.xml.com\/pub\/a\/2005\/11\/09\/fixing-ajax-xmlhttprequest-considered-harmful.html'>fix some of the issues with XMLHttpRequest<\/a>, be aware that mod_alias sends a redirect to the browser.  That is, it sends one of the <a href='http:\/\/www.w3.org\/Protocols\/HTTP\/HTRESP.html'>3XX HTTP status codes<\/a> to the XMLHttpRequest object.  The XMLHttpRequest object then issues the GET itself (well, some do, check out <a href='http:\/\/www.mnot.net\/blog\/2006\/01\/23\/test_xmlhttprequest'>these XMLHttpRequest tests<\/a> for more).  That&#8217;s fine if you&#8217;re doing a GET, but if you&#8217;re doing a POST, then <a href='http:\/\/www.w3.org\/Protocols\/rfc2616\/rfc2616-sec10.html#sec10.3'>some redirects will require user interaction<\/a>.  I found that mod_alias, which was sending a 301 (redirect permanent) just turned the POST request into a GET.  (mod_alias doesn&#8217;t always <a href='http:\/\/www.mooreds.com\/weblog\/archives\/000065.html'>come to the rescue<\/a>, apparently.)<\/p>\n<p>The solution?  Well, since you are really proxying the XMLHttpRequest&#8217;s request, use mod_proxy.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>If you&#8217;re going to use an apache proxy to fix some of the issues with XMLHttpRequest, be aware that mod_alias sends a redirect to the browser. That is, it sends [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6],"tags":[],"class_list":["post-315","post","type-post","status-publish","format-standard","hentry","category-programming"],"_links":{"self":[{"href":"https:\/\/www.mooreds.com\/wordpress\/wp-json\/wp\/v2\/posts\/315","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=315"}],"version-history":[{"count":0,"href":"https:\/\/www.mooreds.com\/wordpress\/wp-json\/wp\/v2\/posts\/315\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.mooreds.com\/wordpress\/wp-json\/wp\/v2\/media?parent=315"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.mooreds.com\/wordpress\/wp-json\/wp\/v2\/categories?post=315"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.mooreds.com\/wordpress\/wp-json\/wp\/v2\/tags?post=315"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}