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
...
hoolio
Cirrostratus
Sep 12, 2008Here is a regex which will match anything not starting with /contact:
^(?!/contact).+$
And here is an option for case insensitive matching:
(?i)^(?!/contact).+$
(?i)^(?!/contact).+$
Options: ^ and $ match at line breaks
Match the remainder of the regex with the options: case insensitive (i) «(?i)»
Assert position at the start of the string or after a line break character «^»
Assert that it is impossible to match the regex below starting at this position (negative lookahead) «(?!/contact)»
Match the characters "/contact" literally «/contact»
Match any single character that is not a line break character «.+»
Between one and unlimited times, as many times as possible, giving back as needed (greedy) «+»
Assert position at the end of the string or before a line break character «$»
Aaron
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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
