Forum Discussion

Farid_Jabari_36's avatar
Farid_Jabari_36
Icon for Nimbostratus rankNimbostratus
Sep 12, 2018

Full host name/URL translation

dear experts i want translate all links in web site body. for example in site body i have multiple links such as web.example.net , mail.example.net and so on . i wand translate all ink in body to web.example.con. some thing like this : Full host name/URL translation in following link http://help.fortinet.com/fweb/582/Content/FortiWeb/fortiweb-admin/application_delivery.htmapplication_delivery_1557589163_935296

 

warmest regards

 

1 Reply

  • Hi,

    try this (replace Host header), use this irule if you want to maintain your URI and change host header:

    when HTTP_REQUEST {
      if { [HTTP::host] eq "web.example.con" } {
        HTTP::header replace "Host" "help.fortinet.com"
      }
    }
    `
    
    
    If you want to rewrite host and uri (redirect from / to uri that you specify)
    
    
    `when HTTP_REQUEST {
      if { [HTTP::host] eq "web.example.con" } {
        HTTP::header replace "Host" "help.fortinet.com"
      }
      if {[HTTP::uri] qe "/"} {
        HTTP::redirect "/fweb/582/Content/FortiWeb/fortiweb-admin/application_delivery.htmapplication_delivery_1557589163_935296"
      }
    }
    

    you can also use HTTP::uri instead HTTP::redirect if you want a transparent redirection.

    Keep me in touch if you need more details.

    regards.