Rewrite Rule on apache2 with tomcat6
I am trying to rewrite a request from a GWT-Webapplication, to be more specific: gwtupload. The Webapplication is bound to apache2 via mod_jk.
I need to rewrite the following request:
http://www.example.com/servlet.gupld?new_session=true&random=0.3840860207955523
To
http://www.example.com/webapp/servlet.gupld?new_session=true&random=0.3840860207955523
Anything after servlet.gupld? has to be variable.
The Webapp itself works fine and is boud like this:
<IfModule mod_jk.c>
JkMount /webapp/* tomcat3
JkLogLevel error
</IfMod开发者_高级运维ule>
While my (not working) rewrite rule looks like this:
<Directory /var/www/www.example.com/www>
Options -Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
RewriteEngine On
RewriteBase /
RewriteRule ^/servlet\.gupld /webapp/servlet\.gupld [PT,L]
</Directory>
For the moment I am always getting a 404 on the request to the servlet.
Can anybody help?
You don't need to escape the "." in the rewrite. You only need /webapp/servlet.gupld
You'll also want QSA
flag in the rewrite rule so that query strings get passed.
精彩评论