Forum Discussion

mahesh_muttath_'s avatar
mahesh_muttath_
Icon for Nimbostratus rankNimbostratus
Sep 28, 2016

301 iRule redirect with a string to match in the URL

Hi I am looking for help to get 301 irule Redirect for my below URL. your immediate help would be much appreciated.i'm in a bit Crisis here now ... :) iRule Experts , over to you..

 

https://abcd.com/sites/swift/%uri% 301 redirect https://x.abcd.com/sites/swift/%uri%

 

but does not affect https://abcd.com/sites/taylorswift/url

 

Best Regards Mahi...

 

1 Reply

  • Try something like this:

    when HTTP_REQUEST {
        if { ([HTTP::host] eq "abcd.com") and ([HTTP::uri] eq "/sites/swift/%uri%") } {
        HTTP::respond 301 Location "https://x.abcd.com/sites/swift/%uri%"
        }
    }