Forum Moderators: phranque
Here I have given my workers.properties snippet & my httpd.conf configuration for url rewrite..
workers.properties:
[uri:www.example.com/tomcatDir/*]
worker=ajp13:localhost:8009
[uri:www.example.com/tomcatDir]
worker=ajp13:localhost:8009
[uri:example.com/tomcatDir/*]
worker=ajp13:localhost:8009
[uri:example.com/tomcatDir]
worker=ajp13:localhost:8009
httpd.conf
<VirtualHost --ip-address-->
DocumentRoot "F:\apache2\htdocs\example\"
ServerName www.example.com
ServerAlias *.example.com
RewriteEngine On
Options +FollowSymLinks
RewriteCond %{HTTP_HOST}!www\.example\.com
RewriteCond %{HTTP_HOST} ^(www\.)?([a-z][a-z0-9_\-]{2,11})\.example\.com
# Rewrite subdomain as a parameter to jsp page
RewriteRule ^/(.*)$ /tomcatDir/xyz.jsp?url=%2&landingPage=$1 [L]
</VirtualHost>
If you review the documentation, you'll find that Apache modules are executed in the reverse order that they are loaded. Therefore, you'll want to load mod_jk before mod_rewrite so that it runs later, and try that along with [PT].
If that doesn't work, you may want to replace the mod_jk/mod_proxy functions with the [P] (proxy-pass-through) function available in mod_rewrite.
Jim