Forum Discussion

NN's avatar
Icon for Altostratus rankAltostratus
Jun 27, 2023

Redirect the domain name on URL, but keep path as the original URI path

Hi All, I'm trying to create an iRule which help me to redirect only the domain name. For example  I want to redirect  to or www.exampl...
  • Hi NN , 

    you can do it with this : 

    when HTTP_REQUEST {
      if { [HTTP::host] equals ""} {
        HTTP::redirect "[HTTP::path]"

    using [HTTP::path] >>> Returns your path in each URI. 
    so if path changed in each request , redirection will happen only on host name and keep the path as it is. 

    GoodLuck 🙂