Forum Discussion
Mike_Graston_10
Nimbostratus
Jan 26, 2007Adding a uri if one doesn't exist
Currently I have a url split between several pools depending on uri portion. How would I modify the Irule to insert a uri if none is present?Any help would be appreciated...
when HTTP_REQUES...
Mike_Graston_10
Nimbostratus
Jan 29, 2007Thanks, that corrected the syntax error I was seeing and should have picked up on! This didn't append the /ghi/ like expected. I changed the rule to have just this in and still didn't get it to work.
when HTTP_REQUEST {
if { [string length [HTTP::uri]] < 2 } {
HTTP::redirect "https://mysite/ghi/"
}
else {
pool www-mypool-ghi
}
}
Also tried
elseif { [string tolower [HTTP::uri]] equals "/"} {
HTTP::respond 301 "Location" "http://mysite/ghi"
}
Also tried:
if { [string length [HTTP::uri]] < 2] } {
HTTP::uri "/ghi/"
}
Also got this from the wikis:
when HTTP_REQUEST {
if { not ([HTTP::uri] starts_with "/ghi/") } {
HTTP::uri /ghi/[HTTP::uri]
}
}
Nothing seems to be working to appen the /ghi/???
Driving me nuts!
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