Im trying to create a proxy from a location on our site to a thrird party's site. Eg

http://www.mysite.com/cat -> proxys to http://www.cat.com

This is the line from my config:

 RewriteRule ^cat/?$ http://cat.com:80 [P]

The proxy essentially works, but the problem is that it returns an error 400 Bad Request. Looking at the Apache access log of the site im proxying to, the incoming request is:

[18/Oct/2011:13:04:46 +0100] "GET  HTTP/1.1" 400 334 "-" "-"

There is no referrer, host, anything. The server returns to the browser:

<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"><html><head>
<title>400 Bad Request</title>
<h1>Bad Request</h1>
<p>Your browser sent a request that this server could not understand.<br />
<address>Apache/2.2.12 (Ubuntu) Server at {cut} Port 80</address>

Any ideas- any help would be great!


 RewriteRule ^cat($|/.*) http://cat.com$1 [P,L]

But this could fail.

The best way in our organization is to map the same path in both:

www.upc.edu/grau -> sites.upc.edu/grau

and not:

www.upc.edu/grau -> sites.upc.edu/


www.upc.edu/grau -> sites.upc.edu/~grau

You can create an alias in destination if needed:

Alias /grau /var/www/docs/grau/  (p.e.)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.