cancel
Showing results for 
Search instead for 
Did you mean: 
Login & Join the DevCentral Connects Group to watch the Recorded LiveStream (May 12) on Basic iControl Security - show notes included.

redirection issue on irule code

Azad
Nimbostratus
Nimbostratus

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

 

}

 

}

3 REPLIES 3

iaine
MVP
MVP

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/

Azad
Nimbostratus
Nimbostratus

Thanks for sharing useful document, but their requirement to remove # as well when the URL redirect to cloud

iaine
MVP
MVP

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?