Forum Discussion
Brian_Kinsey_10
Nimbostratus
Nov 15, 2007Redirect using part of origional URL
I would like to set up a rule that redirects a request such as to http://client1.company.com to http://www.company.com/client1
I know I can do it like this:
when HTTP_REQUEST {
if { ([string tolower [HTTP::host]] equals "client1.company.com")
} {
HTTP::redirect "http://www.company.com/client1"
}
}
But there may be quite a few clients that I need to add to this rule. Is there a way to put whatever is before the .company.com in a variable and redirect to www.company.com/variable_value?
- JRahm
Admin
HTTP::redirect "http://www.company.com/[getfield [HTTP::host] ".company.com" 1]"
- Brian_Kinsey_10
Nimbostratus
Excellent! Works perfectly. Thanks a lot!
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