Forum Discussion
James_Richter_1
Nimbostratus
Mar 12, 2013multiple redirect iRules on a VS
We have a single VS that normally uses a iRule that does a redirect for / to /irj/portal/ When there is maintenance on that system, we want to have a redirect to another web server active but curren...
Kevin_Stewart
Employee
Mar 12, 2013A few things to consider:
1. Are you just add the second iRule when you want the maintenance redirect? And not removing the first? If so, at the very least change the HTTP::redirect commands to an HTTP::respond 302 and see if that helps.
2. If you want [all] users to go to the maintenance page, then it sort of doesn't make sense to trigger it based on the HTTP::uri. You should consider removing the URI condition completely for the maintenance redirect.
3. Perhaps adding another iRule is not the very best approach. You could, alternatively, maintain a data group that sets or unsets maintenance mode based on the HTTP::host field:
Example data group:
www1.example.com := 0
www2.example.com := 1
iRule pseudo code:
when HTTP_REQUEST {
if { ( [class match [string tolower [HTTP::host]] equals host_group] ) and ( [class match -value [string tolower [HTTP::host] equals host_group] equals 1 ) } {
HTTP::respond 302 Location "maintenance page URI"
} elseif { [HTTP::uri] equals "/" } {
HTTP::respond 302 Location "/irj/portal/"
}
}
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