Forum Discussion
OCC_68606
Nimbostratus
May 24, 2011iRule 301 Location
Hi Everybody,
I am looking for a way to the following:
I want to manage several sites and send it with a permanent redirect to general site, for example:
When I enter www.site1.com, www.site2.com, www.site3.com, etc. redirecto to www.generalsite.com
I made the following iRule:
when HTTP_REQUEST {
switch -glob [string tolower [HTTP::host]]{
"www.site1.com" -
"www.site2.com" -
"www.site3.com" {
HTTP::respond 301 Location "http://www.generalsite.com[HTTP::uri]"
}
}
}
Any ideas???
George.
4 Replies
- Michael_Yates
Nimbostratus
That should work.
Are you having a problem with it? - OCC_68606
Nimbostratus
It´s working, but sometimes general site has problems to resolve, I put this iRule in VS for www.generalsite.com. What is wrong?
Do you know another way to validate sites1, 2, 3 with or without "www"???
Thanks.
George - richard_77048
Nimbostratus
Couldn't you just extend the idea you had originally. Like this:
switch -glob [string tolower [HTTP::host]] {
"www.site1.com" -
"www.site2.com" -
"www.site3.com" -
"site1.com" -
"site2.com" -
"site3.com" {
HTTP::respond 301 Location "http://www.generalsite.com[HTTP::uri]"
}
Or did I misunderstand what you wanted to do? - OCC_68606
Nimbostratus
Thank you for your help, It´s working fine.
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