Forum Discussion
Randy_Johnson_L
Nimbostratus
Mar 06, 2017Evaluate full URL for empty URI / Path ?
I need to deploy an iRule that will perform a redirect, based on the HTTP::uri or HTTP::path being empty.
This needs to take into account a user trying 'http://server.company.com' and 'http://server....
Stanislas_Piro2
Cumulonimbus
Mar 07, 2017Hi,
Browser never send empty uri in request.
The request format is :
GET /path HTTP/1.X Or (for some http 1.0 browser)
GET /pathThe uri is always at least /
When you do not enter any path in the browser, it append /
The code is
if {[HTTP::path] eq "/"} {
HTTP::respond 301 Location http://server.company3.com/
}
else {
HTTP::respond 301 Location http://server.company2.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
