Forum Discussion
THawesBPC_28376
May 02, 2017Nimbostratus
Modify HTTP::Host and HTTP::URI in an iRule
I have a need to redirect requests from a subfolder, http://www.website.com/folder/a/b/ for example, to a subdomain of http://folder.website.com/a/b/. I am somewhat able to accomplish this but it doe...
P_K
May 02, 2017Altostratus
Not sure but give this a try!
when HTTP_REQUEST {
if { [string tolower [HTTP::host]] eq "; && [HTTP::uri] starts_with "/folder"} {
HTTP::uri [string map {"/folder" ""} [HTTP::uri]]
HTTP::redirect "http://folder.website.com[HTTP::uri]"
}
elseif {[string tolower [HTTP::host]] eq "; && [HTTP::uri] eq "/folder"} {
HTTP::redirect ";
}
}
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