Forum Discussion
Anish_Srivastav
Nov 01, 2010Nimbostratus
Need help with parsing URI
Greetings!
I have a bunch of URI's in our application like the following
http://foo.bar.com/wiki/a/b/e.html
http://foo.bar.com/wiki/p/q/r/s/t.html
http://foo.bar.com/wiki/x/y/z.html
I would like to do a redirect using iRules to eliminate the first directory "/wiki"
so if a request comes to http://foo.bar.com/wiki/a/b/e.html it should 301 to http://foo.bar.com/a/b/e.html and so on....
Can some one please help me?
Thanks,
Anish
- hooleylistCirrostratusHi Anish,
when HTTP_REQUEST { Check if URI starts with /wiki/ if {[HTTP::uri] starts_with "/wiki/"}{ Send a local redirect without the /wiki string HTTP::respond 301 Location [string range [HTTP::uri] 5 end] } }
- Anish_SrivastavNimbostratusThanks Aaron
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