Forum Discussion
redirection issue on irule code
Have created the irule for redirection from http://pfc-pp.prodactive/jkhg/#/ to pfc.pp.cloud, while redirecting to pfc.pp.cloud i could see # value is not removed
i get the result https://pfc.pp.cloud/#/ i want to remove as well # have to redirect to https://pfc.pp.cloud
can you please help me on this
when HTTP_REQUEST {
if {[HTTP::uri] starts_with "/jkhg"} {
HTTP::uri [string map {"/jkhg" ""} [HTTP::uri]]
HTTP::respond 302 Location "https://pfc.pp.cloud[HTTP::uri]"
TCP::close
}
else {
HTTP::respond 302 Location "https://pfc.pp.cloud[[HTTP::uri]"
TCP::close
}
}
- iaineNacreous
Hi
That's because # represents a HTTP fragment (a location within a page) in the request rather than part of the path. If you either log the request coming in to your F5 or run developer tools in your browser, I suspect that the browser isn't sending anything from /# onwards.
Here's a blog that hopefully explains - https://blog.httpwatch.com/2011/03/01/6-things-you-should-know-about-fragment-urls/
- AzadNimbostratus
Thanks for sharing useful document, but their requirement to remove # as well when the URL redirect to cloud
- iaineNacreous
as i said, i don't believe that # will be presented in the uri call (if the call is made by a browser) - have you been able to capture the requests coming in? can yu see the /#/ present in the request?
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