Forum Discussion
Eric_123944
Nimbostratus
Mar 06, 2013default document and parameter based on host header
Hi I'm quite new to this, so please forgive me if this is something that you've seen before and have already answered.
I have an iRule that I wrote as more of a proof of concept. Basically I wan...
Kevin_Stewart
Employee
Mar 06, 2013Is it safe to say that you're always redirecting away from "/"? If so, you could use a data group based on the host and the new URI:
ltm data-group internal /Common/host_test_group {
records {
site1.domain.com {
data /aaaa/bbbb/page.aspx\?site=site1
}
site2.domain.com {
data /aaaa/bbbb/page.aspx\?site=site2
}
}
type string
}
when HTTP_REQUEST {
if { ( [HTTP::uri] equals "/" ) and ( [class match [string tolower [HTTP::host]] equals host_test_group] ) } {
found a matching host - redirect
HTTP::respond 301 Location [class match -value [string tolower [HTTP::host]] equals host_test_group]
}
}
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