Technical Forum
Ask questions. Discover Answers.
cancel
Showing results for 
Search instead for 
Did you mean: 

irule for url redirect based on client ip

Greg_Hammond
Nimbostratus
Nimbostratus

I have the following irule on a VIP that is listening on port 80. The developers now need the same (or similar) irule to work on the same VIP listening on port 443. The only real difference is what port the VIP is listening on and the default pool. I tried applying this irule to the port 443 VIP but it doesn't work.

 

when HTTP_REQUEST {

  if { 

  ( [IP::addr [IP::client_addr] equals 10.32.96.0/20] ) 

 or ( [IP::addr [IP::client_addr] equals 10.32.128.0/20] ) 

 } {

HTTP::redirect https://m.eocsubmissionsdev.us.mycompany.com[HTTP::uri]

  } else {

pool eocsubmissions3_80-pool

  }

}

 

What am I missing?

1 REPLY 1

Samir
MVP
MVP

​you can write something like below. . Just i have corrected the parameter.

when HTTP_REQUEST { if { ( [IP::addr [IP::client_addr] equals 10.32.96.0/20] ) or ( [IP::addr [IP::client_addr] equals 10.32.128.0/20] ) } { HTTP::redirect "https://m.eocsubmissionsdev.us.mycompany.com[HTTP::uri]" } elseif { pool eocsubmissions3_80-pool } }