Forum Discussion
stupid48
Altocumulus
Apr 05, 2016iRule redirect issue...
Hi there,
I've got a situation where I have a bunch a friendly urls that redirect to unfriendly urls. So, I created an iRule with a switch:
when HTTP_REQUEST {
switch [string tolowe...
Stanislas_Piro2
Cumulonimbus
Apr 07, 2016You can try this update:
when HTTP_REQUEST {
if {[HTTP::host] equals "website.com"} {HTTP::respond 301 Location "http://www.website.com[HTTP::uri]"; return}
switch [string tolower [HTTP::path]] {
"/path1" { HTTP::respond 301 Location "/unfriendlypath1" }
"/path2" { HTTP::respond 301 Location "/unfriendlypath2" }
"/path3" { HTTP::respond 301 Location "/unfriendlypath3" }
}
}
The first condition is to redirect website.com to www.website.com
I updated the HTTP respond with only relative URI and not absolute....
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