Forum Discussion
Extracting/Removing part of a URI
Hello,
Apologies if this has already been asked, however is it possible to extract part of a URI?
For example; an incoming URL may be:
http://originalurl.com/pages/index.htm/2013/08/15/mypost
and we want it to 301 redirect it TO:
http://newurl.com/2013/08/15/mypost
So we'd want to change the host (which is easy enough), however we want to drop the /pages/index.htm part of the original URI while maintaining anything after that; which in this example is /2013/08/15/mypost
Does anyone know if this is even possible?
Any guidance would be kindly appreciated.
Thank you
13 Replies
- Jeff_Knights_44
Nimbostratus
sorry about all the replies, im new at this...
I basically made a list of the 6 different variations they were looking for and repeated everything but the actual word in the directory structure they were looking for.
- Kevin_Stewart
Employee
now to do a list of different possibilities I would just make a list of them? and make the replaceable part a variable?
Are you referring to a list of different URI patterns to replace? If so, just add them in pairs to the [string map ] command:
[string map {"/foo" "" "/bar" ""} [HTTP::uri]] - Jeff_Knights_44
Nimbostratus
wow, that's a lot easier
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
* 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
