Forum Discussion
DNSgeek_90802
Nimbostratus
Dec 28, 2009modifying HTTP::uri not working?
I have an irule that needs to modify the URI of a request before it passes it to a pool of squid servers. What I have is:
when HTTP_REQUEST {
if { $::DEBUG }{
...
hoolio
Cirrostratus
Dec 28, 2009Actually, string trimright won't work as you're expecting. It's not doing a replacement of .html--it's looking for any instance of any character in .html and removing it from the URI:
% string trimright /testtttt.html .html
/tes
If you want to remove .html from the URI, you could use string map:
% string map {.html ""} /testtttt.html
/testtttt
or for your iRule:
HTTP::path [string map {.html ""} [HTTP::path]]
Note that HTTP::path is the URI minus the query string. Assuming you only want to replace .html with nothing in the path this would be more precise.
Aaron
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
