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 file. An example is, the link is redirected to . There are hundreds of embedded links, so the urls will all be different.
Is there a way to redirect, and keep the entire url? Sorry if this is a basic question, but I'm not a scripting person.
- Colin_Walker_12Historic F5 AccountWell, 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.
when HTTP_REQUEST { if {([HTTP::host] eq "getintel.tn.get") && ([TCP::local_port] != 443) } { HTTP::redirect "https://[HTTP::host][HTTP::uri]" } }
- tokenrock_79479NimbostratusThanks for the help!
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