Forum Discussion
Julian_Grunnell
Nimbostratus
Sep 12, 2008HTTPS to HTTP redirect with HTTP Class
Hi - can someone help out with the above please, got the following scenario.
HTTP VS
HTTPS VS
1) anyone who goes to http://sitename/ goes to HTTP VS
2) anyone who goes to http://sitename/contact MUST be redirected to HTTPS VS
3) anyone who goes https://sitename WITH THE EXCEPTION of the /contact page MUST goto HTTP VS
I've been looking at the HTTP Class profiles as you can do redirects with them, the problem I have is with a simple redirect if you goto https://sitename/contact it goes into a loop and IE just errors, Safari actually tells you it's looping. ALL other pages are fine.
So I see that you can define URI Paths within the class to match for so I'm trying to add a rule in the HTTPS redirect that says send ALL HTTPS traffic to the HTTP site that DOES NOT match /contact.
I just don't seem to be able to get the regex right for this - anyone help?
Note: also posted a question about this in the iRules section, but I reckon this will work just as well.
Thanks - J.
- hoolio
Cirrostratus
Here is a regex which will match anything not starting with /contact: - Julian_Grunnell
Nimbostratus
Thanks Aaron - you save the day again!! - hoolio
Cirrostratus
Glad it's working for you. Lookaheads and lookbehinds are a bit more advanced than what I'd expect a manual to cover.
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