Forum Discussion
Will_12716
Nimbostratus
Jul 17, 2008Site Redirect with Irule
We have a situation that requires us to redirect traffic to a different port than port 80.
For example, we need to take any requests to http://www.mysite.com and redirect to http://www....
brice
Nimbostratus
Jul 18, 2008I would try the following. You might want to think about redirecting from service.mysite.com to www.mysite.com/SHCM, and not service.mysite.com/SHCM, but I have created the rule so both host and uri are very portable. The key is using "contains" instead of "equals" I think. See below...
when HTTP_REQUEST {
set uri [HTTP::uri]
set host [HTTP::host]
if { [HTTP::host] contains "service.mysite.com" } {
set uri "SHCM"
}
HTTP::respond 301 Location "http://$host$uri"
}
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