Forum Discussion
Ranvir_Floura_7
Nimbostratus
Sep 22, 2007Redirect during web site maintenance
Here is the scenario that I need some help with. I have a web site (https://my.web.com)that undergoes maintenance once a month and during that maintenance window, i would like regular users to go to a fallback page (i already have an irule for this and it works just fine), but the administrators working on the servers would like to test it before releasing it to the users. They come from a specific network, they need to be able to access the site while regular users go to the fallback page.
How can I automate it, is it possible or do i need to activate the iRule below during maintenance window.
when HTTP_REQUEST {
if { [IP::addr [IP::client_addr] equals 10.1.3.0/255.255.255.0] } {
HTTP::redirect "https://my.web.com/"
}
}
Thanks!
- lori_54451
Nimbostratus
Here is our irule. We have the same issue, we want certain users to be able to access the site to test while everone else is sent to maintenance page, this irule checks for certian ip addresses and sends them to the site, everyone else, gets send to the maintenancne page. Hope you can use it.when HTTP_REQUEST { if { [IP::client_addr] starts_with "10." } { if { [HTTP::uri] eq "/" and [HTTP::host] eq "your.url.com" } { HTTP::redirect "http://your.url.com/wps/portal" } elseif { [HTTP::uri] eq "/" and [HTTP::host] eq "your.url.com" } { HTTP::redirect "https://your.url.com/wps/portal" } else { if { [IP::client_addr] eq "10.0.16.170" } { use pool NG-loadtest1-pool } elseif { [IP::client_addr] eq "10.0.16.175" } { use pool NG-loadtest2-pool } elseif { [IP::client_addr] eq "10.0.16.240" } { use pool NG-loadtest3-pool } else { persist source_addr 255.255.255.255 1800 use pool new-fsc-pool } } } else { use pool nextgen-down } }
- Deb_Allen_18Historic F5 AccountThe first rule I think should have a negative condition to redirect everyone but the admin IP range, other that that looks fine:
when HTTP_REQUEST { if {!([IP::addr [IP::client_addr] equals 10.1.3.0/255.255.255.0])}{ HTTP::redirect "https://my.web.com/" } }
- JIMq_106588
Nimbostratus
Hello, What's the syntax to send the client to a pool instead of a url? - Colin_Walker_12Historic F5 AccountThere is no way to directly send a client to a pool when performing an HTTP::redirect. You would just send them to a domain that resolved to an IP address of the intended destination VIP with the pool in question behind it.
- JIMq_106588
Nimbostratus
Colin, - Colin_Walker_12Historic F5 AccountIf all you're looking to do is say "Source IP 1 goes to pool 1. Source IP 2 goes to pool 2" etc., then you'd want something like:
when CLIENT_ACCEPTED { switch [IP::addr [IP::client_address]] { 10.10.10.10 { pool pool1 } 198.168.5.1 { pool pool2 } 216.46.42.118 { pool pool3 } } }
- JIMq_106588
Nimbostratus
Colin, - Patrick_Chang_7Historic F5 AccountiRules under GTM do not have the same events and methods as iRules under LTM. GTM iRules only know the events DNS_*
- sloopjw_85790
Nimbostratus
How do I write an iRule that would redirect the address http://www.abcd.com to https://portal.abcd1234.com/panet/? I have tried for hours to find this on DevCentral, please post any suggestions and thank you very much. - The_Bhattman
Nimbostratus
Here is an examplewhen HTTP_REQUESTS { If {HTTP::host eq "www.abcd.com" } { HTTP::redirect "https://portal.abcd1234.com/planet/?" } }
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