Forum Discussion
brent112_11716
May 02, 2012Nimbostratus
Rewrite a portion of URI
Is there an easy way to re-write only a portion of the URI? Say i want to turn this.
http://sharepoint/Information Technology/Information Technology Internal/projects/11111/default.aspx
to
http://sharepoint/IT/ITI/projects/11111/default.aspx
I only want to re-write the "Information Technology/Information Technology Internal" to
"IT/ITI" and keep everything after portion of the URI in place, is this even possible?
Thanks,
Brent
- MiLK_MaNNimbostratusHi,
- brent112_11716NimbostratusSo what does your example actually do? I am not sure what the 56 and "ne" are for? Does it set the $path variable to anything after the "/Information Technology/Information Technlogy Internal" and then rewrite the URI with the "IT/ITI" and the path variable appended to it?
Thanks for the help. I am new to irules.
- MiLK_MaNNimbostratusThe findstr command allows you to look for something within a string, then you can issue a skip count which in this case is 56. This means the variable "path" is being stored with everything after "/Information Technology/Information Technology Internal/".
The "ne" just means "not equal to", so if the set statement returns nothing, it won't execute the above HTTP::uri command.
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