Forum Discussion
scott_sams_8256
Nimbostratus
Jun 08, 2010irule redirection question
i guess i am looking for an opinion on an idea i have.
we manage a handful of domains and are starting to get more and more redirect requests. i was told by our ecom director that i should ...
Michael_Yates
Nimbostratus
Jun 09, 2010You could do it that way. The [HTTP::host] vaule of a URL isn't case sensitive only the [HTTP::uri] or [HTTP::path] is and that depends on the Operating System hosting the website.
I this way is alittle cleaner and easier to read:
when HTTP_REQUEST {
switch -glob [HTTP::host] {
"www.website1.com" { HTTP::respond 301 Location "http://www.google.com" }
"www.website2.com" { HTTP::redirect "http://www.yahoo.com" }
"www.website3.com" { pool website3pool }
}
}
HTTP::respond allows you to specify the HTTP Status Code to a 301 (Permanent)
HTTP::redirect gives a default 302 (Temporary) Redirect
or you can route the traffic to a specific pool.
Hope this helps.
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
