Forum Discussion
Matt_Mueller_10
Nimbostratus
Oct 23, 2008Help - starts_with subdomain pool routing?
I'm trying to write an irule that will pool information based on the incoming subdomain\domain used. For example, domain1 will have many subdomains, can I route the traffic to a desired pool based of...
Matt_Mueller_10
Nimbostratus
Oct 23, 2008Well, I got this part of it to work by using the HTTP::host with equals, however I'm struggling with how to auto redirect to a particular virtual directory.
With my http::redirect statement, the site constantly just redirects, instead of allowing the server to post content back to the browser. It does this with both web servers, which are completely different types of services obviously.
Can anyone offer their ideas on logic that would make this work?
Basically, for newbie user who just types in subdomain1.newdomain.com I want to put in logic to nicely redirect them to https://subdomain1.newdomain.com/virtualdir to make things simple.
when HTTP_REQUEST {
Checks the URI and forces to all lowercase for the check first for subdomain1
if { [string tolower [HTTP::host]] equals "subdomain1.newdomain.com" }{
HTTP::redirect "https://subdomain1.newdomain.com/virtualdir/"
pool subdomain1
Checking if URI starts with ftp
} elseif { [string tolower [HTTP::host]] equals "ftp.newdomain.com" }{
HTTP::redirect "https://ftp.newdomain.com"
pool newdomainftp
All non-matching URIs
} else {
pool errorpage
}
}
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