Forum Discussion
http > 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]" }
when the client comes back to the server on HTTPS, there is a "/" after /myco/somesiteorother/
we need /myco/somesiteorother
this is breaking the site..
does any one know how to get rid of the "/" ?
2 Replies
- What_Lies_Bene1
Cirrostratus
I 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}" Apparently [HTTP::uri] add the "/" onto the end of the URI remove this and it goes away on the re-direct..
HTTP_REQUEST { HTTP::redirect "https://[getfield [HTTP::host] ":" 1]/myco/somesiteorother[HTTP::uri]" }
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
* 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