jQuery in Action, 2nd edition
The moose likes HTML, CSS and JavaScript and the fly likes AJAX Apache redirect doesn't work Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Elasticsearch in Action this week in the Big Data forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "AJAX Apache redirect doesn Watch "AJAX Apache redirect doesn New topic

AJAX Apache redirect doesn't work

s Joshi

Joined: Sep 26, 2005
Posts: 12

I have an HTML page which uses AJAX and its deployed on Apache server without tomcat module (e.g. http://abc.domain.com/test.html). I am making an AJAX call to /xyz/proxy.jsp from this html page and it gets permanent redirected to http://xyz.mydomain.com/proxy.jsp (using Redirect in Apache configuration).

If I visit http://abc.domain.com/xyz/proxy.jsp using a browser, then it gets redirected to http://xyz.mydomain.com/proxy.jsp but my AJAX calls are not being made.

Any ideas?

Eric Pascarello

Joined: Nov 08, 2001
Posts: 15379
First off if you put a simple text file on your server in the same directory does you code fetch it.

Next JavaScript has a same domain policy where the script can only worth with other info in the calling domain. Think it has issues with sub domains.

if you page is here

you would have to call a proxy in the same location

That proxy would have to go and get another page from an outside source.

s Joshi

Joined: Sep 26, 2005
Posts: 12
Thanks for answering.

My proxy is on other machine.

My Apache server is not capable of handling JSP/PHP requests (restriction). My AJAX procedure makes call to "/xyz/proxy.jsp", which gets redirected to http://xyz.mydomain.com/proxy.jsp using Apache Redirect. This redirect never takes place from AJAX call.
jQuery in Action, 2nd edition
subject: AJAX Apache redirect doesn't work