Forum Discussion
pedinopa_170325
Nimbostratus
Oct 03, 2016irule to edit a URI
I have been working on an irule that will edit a URI string. What I need it to do is simply add a .domain.com after the first directory of the uri path and redirect to the new URI. I have it kind o...
Oct 04, 2016
You forgot the preformatted code again. 🙂
Skip the curly braces and you should be good to go. Apparently they prevent the use of variables.
when CLIENT_ACCEPTED { '
set hsl [HSL::open -proto UDP -pool graylog2-syslog-pool]
}
when HTTP_REQUEST {
HSL::send $hsl "This is the HTTP URI [HTTP::uri]"
HSL::send $hsl "This is the HTTP Path [HTTP::path]"
set directory [lindex [split [HTTP::uri] "/"] 1]
set uri [string map -nocase "/$directory/ /" [HTTP::uri] ]
HSL::send $hsl "This is the new uri $uri"
HTTP::redirect "http://$directory.domain.com$uri"
when this works I will append the new uri to the redirect
}
/Patrik
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