0

I have apache2 exposing a jboss through mod_proxy_ajp on / and serving some static content with

ProxyPass /static !
ProxyPass / ajp://localhost:8009/

in proxy_ajp.conf. I need to redirect all the traffic on www.example.com to example.com and it works for all the static resources in /static but if I retrieve www.example.com/hello the url is not rewritten.

My Virtual Host config is the following

<VirtualHost *:80>
        ServerName www.example.com
        RedirectMatch 301 (.*) http://example.com$1
</VirtualHost>

<VirtualHost *:80>
        ServerName example.com
</VirtualHost>

What is wrong? I think that proxy_ajp is catching the request before is pass through apache and the url is redirected.

Giacomo
  • 1
  • 1
  • Did the answer given by @H.-Dirk Schmitt work? I am looking for the same answer. If so give it a check so I and others can know. Thanks. – Bill Rosmus Sep 20 '12 at 18:34

1 Answers1

0

I think that you have forgotten the ProxyPassReverse statement. It has the same parameters as the ProxyPass statement.

Try:

 ProxyPass        /static !
 ProxyPass        / ajp://localhost:8009/
 ProxyPassReverse / ajp://localhost:8009/
H.-Dirk Schmitt
  • 654
  • 4
  • 9