Forum Discussion

Ricardo_110399's avatar
Ricardo_110399
Icon for Nimbostratus rankNimbostratus
Oct 09, 2013

Can´t redirect uri with #! special character in it

Hi, I´m having some problems with redirection of uri that contains ! special characters in it. I recieve an request like: http://testsites.company.it/index.html!company-register.html

 

I tried with httpclass uri paths, but I can´t intercept it. I tried with irules, logging information about what the f5 is recognizing the uri's parts and showed me [HTTP::path]=/company-register.html, [HTTP::uri]=/company-register.html.

 

when HTTP_REQUEST { if { [HTTP::uri] ends_with "company-register.html" }{ log local0.alert "Path: [HTTP::path] -- Uri:[HTTP::uri] - after" log local0.alert "https://[HTTP::host]/index.html!company-register.html" HTTP::redirect "https://[HTTP::host]/index.html!company-register.html" } }

 

Apart from that, I don´t understand why I entered to the if (because the code is logging) but I couldn´t redirect. Can somebody help me with that? Regards Ricardo.

 

4 Replies

  • Ricardo

     

    Looks like an escape problem. '' has a special meaning in TCL. If the problem is the tcl interpreter you could try to use literal quoting like this: ( the {} style quoting prevents being parsed by the interpreter ) set redir_uri "https://"; append redir_uri [HTTP::host]; append redir_uri {/index.html!company-register.html}; HTTP::redirect $redir_uri;

     

    If not ... html encoding might work.

     

  • ib, I tried what you said but it didn´t work. I already talked with developers and they are changing sone things in the application (an old and inherited code). Thanks for you answer.