Forum Discussion

Mark_S__182830's avatar
Mark_S__182830
Icon for Nimbostratus rankNimbostratus
Apr 06, 2015

iRule w/Special Character (#) in Original URI

I am using my standard redirect syntax, however I believe it is broken due to using a in the source URI.

I've tried using a \ to escape it, as well is curl brackets with no success.

Help would be greatly appreciated!

when HTTP_REQUEST priority 450 {

  switch -glob [string tolower [HTTP::host]] {

"www.integration.domain.com" {

  switch -glob [string tolower  [HTTP::uri]] {

"/blah1/blah2.aspx/" {
    HTTP::respond 301 Location "https://www.integration.domain.com/newsite/site.aspx!/"
}
  • Hamish's avatar
    Hamish
    Icon for Cirrocumulus rankCirrocumulus

    Have you tried encoding it with a '%23'? e.g.

    switch -glob [string tolower  [HTTP::uri]] {
      "/blah1/blah2.aspx%23/" {
        HTTP::respond 301 Location "https://www.integration.domain.com/newsite/site.aspx%23!/"
      }
    

    H

  • That character is never sent to the destination(BIG-IP). It is a fragment identifier, and is used on the client side only(browser).