Forum Discussion
eirikn
Nimbostratus
Sep 25, 2015Redirecting/rewriting part of URI
Hi Guys and Gals,
I would like to redirect all incoming requests to a url, but keep part of the URI:
Example:
www.mysite.no/alfa-beta-charlie/whatever must re redirect to www.mysite....
Brad_Parker
Cirrus
Sep 25, 2015Try this,
when HTTP_REQUEST {
if { [string tolower [HTTP::uri]] starts_with "/alfa-beta-charlie/"}{
HTTP::respond 302 noserver Location "http://[HTTP::host][string map {alfa-beta-charlie alfa-beta} [HTTP::uri]]"
}
}
eirikn
Nimbostratus
Sep 30, 2015Works like a charm! Thanks alot Brad :)
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