Forum Discussion
Bryce_Halkerst1
Nimbostratus
Oct 14, 2015Domain Redirect iRule
All,
Having issues with setting up irule to redirect any host equals with URL = / to redirect to the home page, then allowing anything coming over with /* to maintain the full path. Seems pretty str...
Kevin_Stewart
Employee
Oct 14, 2015The equals operator doesn't support a wildcard match. But nevertheless:
} elseif { not ( [HTTP::uri] equals "/" ) } {
HTTP::respond 301 Location "http://www.blah.com[HTTP::uri]"
}
would create an infinite loop for any traffic that wasn't just "/". Important to observe of course that in the absence of a URI path in the browser, HTTP::uri will still return "/". So the first iRule didn't work?
when HTTP_REQUEST {
if { [HTTP::uri] equals "/" } {
HTTP::redirect ...
}
}
This explicitly states that if the URI path is nothing/empty, then redirect, and implies that anything else be allowed through. You may otherwise not be meeting the HTTP::host qualifications.
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