I'm having problems with RewriteRule. My tomcat application is Xyz and it is placed in its folder on localhost. Server name is www.mydomain.com. Application can be reached with www.mydomain.com/Xyz, but I would like to reach it with www.mydomain.com. Is it possible to achieve this with RewriteRule?
I use JkMount within the Apache configuration file:
JkMount /Xyz worker1
JkMount /Xyz/* worker1
where worker1 is member of worker defined as:
worker.list=worker1
worker.worker1.type=ajp13
worker.worker1.port=8009
worker.worker1.host=localhost
worker.worker1.lbfactor=1
I tried to add to the Apache configuration file RewriteRule just before JkMount:
ServerName www.mydomain.com
RewriteEngine on
RewriteRule ^/(.+)$ /Xyz/$1 [L,PT]
but with no success. Application can be easily reached with www.mydomain.com/Xyz, but www.mydomain.com doesn't work at all. it just produces error message...
Any suggestions?