Forum Discussion

wyuen_99269's avatar
wyuen_99269
Icon for Altostratus rankAltostratus
Nov 07, 2013

IRULE - rewrite

I would like find out how to write an Irule that will do the following:

 

I have a domain header "fake.ca" and redirect to fake1.ca/english but want to kept fake.ca/english in client browser. Another question, how would I write an Irule to verify a URL.

 

5 Replies

  • This will work;-

    if {[HTTP:host] eq "fake.ca"} {
        HTTP::header replace Host "fake1.ca"
    }
    
    if {[HTTP::path] eq "/"} {
        HTTP::uri "/english"
    }
    

    Verify a URL how?

  • I would also like to find out how to verify the path contain nothing

     

    • IheartF5_45022's avatar
      IheartF5_45022
      Icon for Nacreous rankNacreous
      A path always starts with a "/" even when they not entered anything, so the following checks for empty path;- if {[HTTP::path] eq "/"} { }
  • In the browser they only see a domain they have enter but in the back it would redirect under to other place.