Forum Discussion
adrian_171483
Cirrus
Dec 10, 2014http > https redirect adding a " / " at the end..
Hi all,
I have a slight issue on a irule redirect we are using..
when HTTP_REQUEST {
HTTP::redirect "https://[getfield [HTTP::host] ":" 1]/myco/somesiteorother[HTTP::uri]"
}
whe...
What_Lies_Bene1
Cirrostratus
Dec 10, 2014I assume the final / is in the original request URI [HTTP::uri]. You can prove this if you add a logging statement like this before the HTTP::redirect command: log local0. "Original URI: [HTTP::uri]"
Something like this shouldn't be breaking your site anyway, sounds like poor code.
If you really must remove the / you'll need to modify the URI before you do the redirect. Something like this should work;
set newuri [string trimright [HTTP::uri] "/"]
and modify your redirect like so;
HTTP::redirect "https://[getfield [HTTP::host] ":" 1]/myco/somesiteorother${newuri}"
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