tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject Tomcat 8 Rewrite Valve
Date Tue, 13 Oct 2015 14:10:00 GMT
Hello - I'm having issues implementing a HTTP 301 redirect via the Rewrite 
Valve module.

Ref -

Tomcat v8.021 is running on Ubuntu 14.04 x64.

The requirement is to run the rewrite config globally for all webapps, for 
this reason the valve is set inside the host.


<Host name="localhost" 
<Valve className="org.apache.catalina.valves.rewrite.RewriteValve"

<Manager className="org.apache.catalina.session.PersistentManager" 
<Store className="org.apache.catalina.session.FileStore" />

<Valve className="ch.qos.logback.access.tomcat.LogbackValve" quiet="true"
filename="${catalina.base}/conf/logback-access-localhost.xml" />

Redirect set inside - conf/Catalina/localhost/rewrite.config

RewriteCond     %{REQUEST_URI}          ^/abc/key$
RewriteRule     ^/abc/key(.*)           /audit-management-ds-1.0/info 

Test - curl -vv -X GET http://ubt-srv-14-01:10080/abc/key

* Hostname was NOT found in DNS cache
*   Trying
* Connected to ubt-srv-14-01 ( port 10080 (#0)
> GET /abc/key HTTP/1.1
> User-Agent: curl/7.35.0
> Host: ubt-srv-14-01:10080
> Accept: */*
< HTTP/1.1 404 Not Found
* Server Apache-Coyote/1.1 is not blacklisted
< Server: Apache-Coyote/1.1
< Content-Length: 0
< Date: Tue, 13 Oct 2015 13:52:20 GMT

Debug has been enabled on logging yet nothing is showing in the redirect 
in the access log.

However - logs do appear for curl -X GET 

Any ideas?



The Mileage Company Limited is a limited company registered in England under company number
2260073 whose registered office address is at
Astral Towers, Betts Way, London Road, Crawley, West Sussex, RH10 9XY.

This email and any files transmitted with it are confidential and intended solely for the
use of the individual or entity to whom they
are addressed. If you have received this email in error please notify the system manager.

This footnote also confirms that this email message has been swept by Mimecast for the presence
of computer viruses. 

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message