I have AJAX code where if you request an AJAX call to remote server the request fails:
function loadXMLDoc() {
if (window.XMLHttpRequest) {
// code for
I wanted to post another variation on the top answer. I tried to use ProxyPass
in my .htaccess file but I kept getting Internal Service Errors. Finally after some reading I discovered there was another way to do this with the rewrite engine.
RewriteEngine On
RewriteRule ^mail.php$ http://otherwebsite.com/mail.php [P,L]
The P in [P,L]
tells the rewrite system that its using mod_proxy
. This worked for me and I didn't get internal server errors.
The advantage to this approach is since it's using the Rewrite Engine
, you have more control over the variables you might need to dynamically send to the script.