Forum Discussion
Kenny_Koulabout
Nimbostratus
Dec 03, 2014Need help rewriting the middle of a URI
I am unsure of how to rewrite the middle of a uri.
What I am trying to accomplish is this:
www.company.com/common/images/sbox/common/images/sbox/any.jpg
and removing the repeating portion of th...
John_Alam_45640
Dec 03, 2014Historic F5 Account
Try this:
/common/images/sbox/common/images/sbox*" { HTTP::redirect http://[HTTP::host][string range [HTTP::path] 19 end]}
or if you want to dynamically eliminate duplicated words:
set path [regsub -all {\/(\S+)\1+} [HTTP::path] {\1}]
HTTP::redirect http://[HTTP::host]$path
Kenny_Koulabout
Nimbostratus
Dec 03, 2014John,
this
/common/images/sbox/common/images/sbox*" { HTTP::redirect http://[HTTP::host][string range [HTTP::path] 19 end]}
didn't end up working. It would not rewrite the URI at all. It is staying in it's original state.
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