Forum Discussion
TJ_Vreugdenhil
Cirrus
Sep 08, 2011Redirect iRule from a subdomain to a root domain
users access http://test
Goal: creating a iRule to redirect testsite.com so it will be new.testsite.com
I tried the iRule below but everytime the user makes the request it appends 'testsite.c...
Michael_Yates
Nimbostratus
Sep 08, 2011The second iRule portion will only look for and redirect if the HTTP::host equals "test" specifically.
You could change the logic so that if it does not equal "new.testsite.com" then it would redirect you to it to cover all known and unknown possibilities.
Something like:
when HTTP_REQUEST {
if { !([HTTP::host] equals "new.testsite.com") } {
HTTP::redirect "https://new.testsite.com[HTTP::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