Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Agile forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

AJAX Apache redirect doesn't work

 
s Joshi
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

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?

Thanks.
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
http://abc.domain.com/test.html

you would have to call a proxy in the same location
http://abc.domain.com/proxy

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

Eric
 
s Joshi
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic