Forum Discussion

Ayush07's avatar
Icon for Altostratus rankAltostratus
Jan 11, 2023

Redirect all URLS's from one domain to another domain with same subdomain

Hi All,

Looking for Irule to redirect all URLS from * to *
where * can be anyting and only this * part will be same in both.

Thank you


4 Replies

    • Ayush07's avatar
      Icon for Altostratus rankAltostratus

      Hi Mohamed,

      Thanks, Given irule i already have on many VIP's, which is for individual URL redirection, but in this i am looking for redirection from * to *, where * can be anything.

      how would i catch * prefix coming in and then put that value into redirect * ?

      for examples redirect,, so on to,, so on. with URI path as well.

      • Hi Ayush07 , 
        Well, sorry for miss understanding. 
        I have simulated your scenario in my lab and I achieved it. 
        so look first at my lab environment and Check my script for your Environment : 
        > My lab iRule : 

        and This is the iRule Result : 

        where "shopping" is the Fixed part and I swapped the rest of host part , after that I redirected to new host.

        > and now I have written this iRule to match your environment , in the same way I hope it works with you : 


        when HTTP_REQUEST {
        if {[HTTP::host] contains ""} {
        HTTP::host [string map {"" ""}[HTTP::host]]
        HTTP::redirect https://[HTTP::host]


        Try it and keep me updated