Forum Discussion
dsirrine_24840
Altostratus
Aug 18, 2009subdomain redirect question
Issue: I have a domain foo.com. foo.com and www.foo.com need to be redirected to www.bar.com/foo. However, users.foo.com needs to be redirected to sub.bar.com/account/login. My irules look as such:...
dennypayne
Employee
Aug 18, 2009Hi,
That looks OK to me, you can try adding logging to see if the host is really showing up as you expect:
when HTTP_REQUEST {
if {[HTTP::host] eq "users.foo.com"} {
log local0. "Found users in [HTTP::host]"
HTTP::respond 301 Location "http://sub.bar.com/account/login/"
}
elseif {[HTTP::host] contains "foo.com"} {
log local0. "Did not find users in [HTTP::host]"
HTTP::respond 301 Location "http://www.bar.com/foo"
}
The logs will show up in /var/log/ltm.
Denny
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