-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Lyallex,
On 4/28/16 1:12 PM, Lyallex wrote: > apache-tomcat-7.0.42 jdk1.8.0_77 CentOS Linux 7.2.1511 > urlrewritefilter-4.0.3.jar > > I'm using the rewrite filter from http://tuckey.org/urlrewrite/ > > I have a rule, it's supposed to 301 perm-redirect from http to > https > > <rule> <name>seo redirect</name> <condition name="host" > operator="notequal">^www.example.com</condition> <condition > name="host" operator="notequal">^localhost</condition> > <from>^/(.*)</from> <to type="permanent-redirect" > last="true">https://www.example.com/$1</to> </rule> > > The problem is despite setting the to-type to permanent-redirect > I'm actually getting a 302 temporary-redirect. > > I know this is probably off topic but if anyone has any experience > of this I'd be gratefull to hear how you solved it - From the documentation for "condition": " notequal Not equal to. (i.e. request value != condition value). Note, this operator *only work with numeric rule types*. " (emphasis mine) Then again, there is immediately following it an example of where a regular expression is almost certainly being used: " <condition name="user-agent" operator="notequal">Mozilla/[1-4]</conditio n> " You might want to post a question to the Google Group for url-rewrite. This might be a bug (at least in their documentation). As for the incorrect redirect status, are you sure it's the rewrite filter redirecting you? Jieryn points-out in a separate reply that if you are using a user-data-constraint, you may already be redirected by Tomcat before url-rewrite gets to look at the request. - -chris -----BEGIN PGP SIGNATURE----- Comment: GPGTools - http://gpgtools.org Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iEYEARECAAYFAlciiPQACgkQ9CaO5/Lv0PDusQCcDrmV6fZlQWUsjvyVowD6bgvu BG4An1R9lKLudJlTa0yM7yMKUrrmEjvi =3AxZ -----END PGP SIGNATURE----- --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org