Forum Discussion
Conditional HTTP/S Redirect - Source IP Range
My internal clients all fall within the private 10.0.0.0/8 IP address range. I'm looking for an iRule that will deliver all of the requirements listed below. The iRule will be attached to a single LTM virtual server that serves both internal and internet clients:
•Redirect all http to https
• 10.0.0.0/8 access to "https://portal.test.net/vcac" and "https://portal.test.net" should be permitted.
•Internet access to "https://portal.test.net/vcac" and "https://portal.test.net" should be redirected to "http://error.test.net/oops".
•Internet access to "https://portal.test.net/vcac/org/*" should be permitted i.e. any string/uri following the "/org/" is ok.
Can anyone help please?
Many thanks
R
1 Reply
- Kevin_Stewart
Employee
This should be pretty close to your description:
when HTTP_REQUEST { if { [IP::addr [IP::client_addr] equals 10.0.0.0/8] } { local clients - allow all access return } else { remote clients if { [string tolower [HTTP::uri]] starts_with "/vcac/org/" } { permit return } else { redirect HTTP::redirect "http://error.test.net/oops" } } }
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
* 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