I am using UrlRewriteFilter to redirect to SSL. I am running Glassfishv2.
My rule looks something like this now. It's in my urlrewrite.xml in WEB-INF of my war folder. Is there any other glassfish setting that needs to be set?
<rule>
<condition name="host" operator="notequal">https://abc.def.com</condition>
<condition name="host" operator="notequal">^$</condition>
<from>^/(.*)</from>
<to type="permanent-redirect" last="true">https://abc.def.com/ghi/$1</to>
</rule>
But FF keeps saying that the URL redirect rule is in a way that it will never complete. I am not exactly sure whats happening here. any ideas?
I suspect the problem is that the value of the host
header (which you're comparing against) does not contain the scheme used to access the resource, where your comparison value does. This means that the condition is always true, because the host never equals what you're comparing it to, leading to an infinite redirect loop.
Looking at the documentation for UrlRewriteFilter
, you should be able to do something like this to get what you want:
<rule>
<condition type="scheme" operator="notequal">https</condition>
<condition name="host" operator="equal">abc.def.com</condition>
<from>^/(.*)</from>
<to type="permanent-redirect" last="true">https://abc.def.com/ghi/$1</to>
</rule>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With