All,

On 3/21/22 10:19, Felix Schumacher wrote:

Am 21.03.22 um 06:39 schrieb rupali singh:
Hi Felix,

location of context.xml file is

  cat context.xml| grep RewriteValve
     <Valve className="org.apache.catalina.valves.rewrite.RewriteValve" />
  pwd
/opt/tomcat/apache-tomcat-9.0.54/instance/conf
That context.xml is thought to be a default template for all installed webapps. It will work, but remember, that every installed webapp will get its own copy of a rewrite valve.

+1

This is probably the problem.

more
/opt/tomcat/apache-tomcat-9.0.54/instance/webapps/ROOT/WEB-INF/rewrite.config
RewriteCond %{QUERY_STRING} p=10001
RewriteRule ^/apex/f$ /apex/myapp [R,L]


I think you want:

RewriteCond %{QUERY_STRING} p=10001
RewriteRule ^/f$ /myapp [R,L]

The prefix /apex is already a part of the context-path and should be removed from the URL patterns being matched. If you want to redirect to another web application, you need a fully-qualified redirect like this:

RewriteCond %{QUERY_STRING} p=10001
RewriteRule ^/f$ https://www.google.com/ [R,L]

-chris

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to