Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a legacy site for a charity running on an old Apache 1.3 instance, behind Apache 2 running proxypass. When a request comes to, Apache 2 sends it internally to localhost:8080 which works fine.

The problem: works but (no trailing slash) does not. The URL it changes to in Chrome is which doesn't exist.

The same is true for all other directories.

Apache 2:

<VirtualHost *:80>
    ProxyPreserveHost On
    ProxyPass / http://localhost:8080/
    ProxyPassReverse / http://localhost:8080/

Apache 1:

NameVirtualHost *:8080
<VirtualHost *:8080>
    DocumentRoot /usr/www/html/
    RewriteEngine on
    RewriteCond %{REQUEST_METHOD} !^(GET|POST|HEAD)$
    RewriteRule .* - [F]

I thought a simple solution would be to add a rewriterule in either virtualhost but I've not had any success despite many attempts. I think a key issue is it's wrongly looking on when the slash isn't there. It would be great if anyone can help me out, ask me any additional info that would be useful.

share|improve this question
A trace of exactly what gets sent back and forth between your Apaches, and Apache and the browser, in the erroneous case, would be handy. I still think there's a URL rewriting issue going on here somewhere. – womble Jul 15 '11 at 13:35
@womble How would you recommend I produce a trace? I have checked the logs and nothing is appearing in access or error for either virtualhost. – Ben Jul 15 '11 at 13:48
tcpdump would work. – womble Jul 15 '11 at 22:18

I see no ProxyPassReverse or mod_proxy_html directives in your config; the lack of ProxyPassReverse, specifically, is likely to be the cause of your issue as the backend Apache is sending a redirect to the slashful URL, but has it's internal name in the Location: header, and without ProxyPassReverse the frontend Apache is just letting that internal URL leak.

mod_proxy_html is for the equivalent issues, but in HTML rather than HTTP headers. It's also worth using, unless you're really sure nobody's going to go putting a full URL in the HTML (which, for any dynamic webapp, is a bad bet).

share|improve this answer
Thanks - I have added ProxyPassReverse / localhost:8080 and restarted the server, unfortunately the same issue remains and it's trying to load up when accessing - I've added the new line to original post. – Ben Jul 15 '11 at 13:30

Your Answer


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.