Forum Discussion

Jeff_Nguyen_449's avatar
Jeff_Nguyen_449
Icon for Nimbostratus rankNimbostratus
Jun 28, 2011

help with wildcard uri into a website file redirect

I need help. I'm trying to direct everything that is requested under /proccaps/igs/ to the redirect uri file. But it only redirect if specific mysite.website.com/proccap/igs. Here's what i have so far. Appreciate any help you can provide me. Thanks in advance.

 

 

when HTTP_REQUEST {

 

if { [string tolower [HTTP::host]] equals "mysite.website.com" and [string tolower [HTTP::uri]] equals "/proccap/igs/*"} {

 

HTTP::redirect "https://newsite.website.com/sites/igs/eusp/default.aspx?PageView=Shared"

 

}

 

}

2 Replies

  • HI Jeff,

    If you want to redirect only if the host is mysite.website.com and if the URI starts with /proccap/igs/, you can change your URI check from equals to "starts_with":

    when HTTP_REQUEST {
       if { [string tolower [HTTP::host]] equals "mysite.website.com" \
          and [string tolower [HTTP::uri]] starts_with "/proccap/igs/"} {
          HTTP::redirect "https://newsite.website.com/sites/igs/eusp/default.aspx?PageView=Shared"
       }
    }
    

    Aaron