Forum Discussion
kirk_stanford_5
Sep 23, 2014Nimbostratus
iRule redirect to URI based on source network
I need to redirect most internal RFC 1918 networks to a URL and then everything else redirect to a different URL. The specifics are below:
If one of these networks:
10.0.0.0/8
192.168...
shaggy
Sep 23, 2014Nimbostratus
Verify that the "private_net" data group exists on your F5 ( Local Traffic | iRules | Data Group List ) and that it contains the IP addresses you expect.
when HTTP_REQUEST {
if { [class match [IP::client_addr] equals private_net } {
HTTP::redirect "http://www.somewebsite.com/internal.html"
} else {
HTTP::redirect "http://www.somewebsite.com/external.html"
}
The following post has more options/discussion regarding redirecting based on client IP: https://devcentral.f5.com/questions/irule-redirect-based-on-client-ip-address
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