Forum Discussion
tokenrock_79479
Jul 19, 2011Nimbostratus
http to https redirect with filename
We've recently migrated a server to only respond to https requests, but the site has many embedded file links that are http. The built in irule redirects the client, but it looses the url link to the...
Colin_Walker_12
Jul 19, 2011Historic F5 Account
Well, you have two straight-forward options here. One would be to redirect the requests to the appropriate HTTPS link as they come in. The other is to re-write the content of the response the server is sending to convert them to HTTPS links before the client even sees them, so they would never request the non HTTPS links.
The redirect that you asked for would look something like:
when HTTP_REQUEST {
if {([HTTP::host] eq "getintel.tn.get") && ([TCP::local_port] != 443) } {
HTTP::redirect "https://[HTTP::host][HTTP::uri]"
}
}
This will look for any request to your domain that isn't connecting via SSL and redirect it to the same host-name and URI, but via HTTPS. That's my understanding of what you were looking for, is that correct?
If you're interested in the content re-writing option let me know and I can give you an example.
Colin
Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects