Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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>
</head><body>
<h1>Bad Request</h1>
<p>Your browser sent a request that this server could not understand.<br />
</p>
<hr>
<address>Apache/2.2.12 (Ubuntu) Server at {cut} Port 80</address>
</body></html>

Any ideas- any help would be great!

Thanks

share|improve this question

1 Answer 1

 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/

or

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.)
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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