Forum Discussion

mj16othman's avatar
mj16othman
Icon for Altostratus rankAltostratus
Apr 10, 2022
Solved

HTTP Header insert

HI all  Guys im facing an issue. I have a domain lets say "abc.osm.com" Now currently when the users type in their browser "abc" its automatically  opens the website for them. I want to create an i...
  • Enes_Afsin_Al's avatar
    Apr 10, 2022

    Hi mj16othman,

    when HTTP_REQUEST {
    	if { [HTTP::host] equals "abc" } {
    		HTTP::redirect http://abc.osm.com[HTTP::uri]
    		return
    	}
    }

    If you need it for many hostnames:

    when HTTP_REQUEST {
    	switch [HTTP::host] {
    		"abc" -
    		"def" -
    		"xyz" {
    			HTTP::redirect http://[HTTP::host].osm.com[HTTP::uri]
    			return
    		}
    	}
    }