mardi 7 mai 2019

Redirect HTTP to HTTPS resin

I have a web application hosted on resin server. I want to redirect the http request to https. I checked the documentation and wrote the code in web.xml.

<resin:Redirect regexp="^/login" target="https://hostname/login">
    <resin:IfSecure value="false"/>
</resin:Redirect>

and this works fine.

But I also wanted to get the host name from the http to use the same in target something like (i.e. to keep the host name dynamic )

<resin:Redirect regexp="http://[^/]+/login" target="https://$1/login">
    <resin:IfSecure value="false"/>
</resin:Redirect>

but this is not working?

Hopefully anyone can help me! Thank you!




Aucun commentaire:

Enregistrer un commentaire