Forum Discussion

Mohamed_Fathy's avatar
Mohamed_Fathy
Icon for Nimbostratus rankNimbostratus
Jun 09, 2020

Need to change request host & uri before reaching server

we've a website where the user access it using "subdomain.domain1.com" (its public DNS), but we need need BIG-IP LTM to change the hostname & uri before reaching server so to be "domain2.com\uri". may you help?

1 Reply

  • Hello Mohamed.

    You can try something like this:

    when HTTP_REQUEST {
    	if { [HTTP::host] equals"subdomain.domain1.com"} {
    		HTTP::header replace Host "domain2.com"
    		HTTP::uri /uri[HTTP::uri]
    	}
    }

    This example modifies Host header and also concats "/uri" string to the whole URI sentence.

    Regards,

    Dario.