Forum Discussion
Ashley_Penney_5
Nimbostratus
Oct 09, 2008http/https redirection based on URI
Hi,
I'm crafting two new irules, with the intention of keeping people https if the uri contains /secure/, and http if not. I know this is probably a terrible idea, but it's what I've b...
Ashley_Penney_5
Nimbostratus
Oct 09, 2008Thanks for helping with this!
The logic is:
For requests over 80:
If the URI contains /secure/, and is .html, .htm (yeahhhh) or .php, rewrite that request to be https.
For requests over 443:
If the URI doesn't contain /secure/, rewrite the request back to http.
------------
To start with we just did this with a couple of straight forward redirects, but as you said in your reply the problem is that we need to rewrite any references to http to https in the page content, to avoid the warning.
However, we're constrained by one problem thanks to the way they built the website, here's a snippet of the html:
As you can see, we can't do a replace on http to https, and I just realised that the stream stuff is aimed at rewriting the content of the response. The developers have refused to use absolute url's, so there's nothing I can do to get http in there.
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