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.