Forum Discussion
pedinopa_170325
Nimbostratus
Sep 14, 2016irule question
I want to write an iRule that will look at the client IP and direct the to a specific URL. I need some help with the irule
if CLIENT_IP -LIKE X.X.X.X
[
HTTP_REQUEST HTTP://SERVER/INDEX.HTM...
Vijay_E
Cirrus
Sep 14, 2016HTTP::redirect will give you a 302 redirect. For 301 redirect, you would have to utilize:
HTTP::respond 301 Location "http://[HTTP::host]/index_new.htm"
Fixing some syntax issues:
when HTTP_REQUEST {
if { [IP::addr [IP::client_addr] equals x.x.x.x] } {
HTTP::redirect "http://[HTTP::host]/index_new.htm"
}
}
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