Forum Discussion

DudiTrustnet_33's avatar
DudiTrustnet_33
Icon for Nimbostratus rankNimbostratus
Oct 30, 2017

Create iRule 404 Page redirect

Hi All i have a web site that go https://mysite.com/test

 

i want to create iRule that says

 

if someone write the site with mistake for example

 

https://mysite.com/tst (tst instead of test)

 

instead of getting 404 error page

 

he will redirect to

 

https://mainsite.com

 

Thanks All!

 

  • Create an iRule as below:

     

    when HTTP_RESPONSE { if { [HTTP::status] contains "404"} { HTTP::redirect "" } }

     

    Assuming you will have an http and https version, you will need to apply this iRule to the relevant VS.

     

  • Create an iRule as below:

     

    when HTTP_RESPONSE { if { [HTTP::status] contains "404"} { HTTP::redirect "" } }

     

    Assuming you will have an http and https version, you will need to apply this iRule to the relevant VS.