Redirect to new domain

  • Redirect to new production site, except some uri.

Requirement

  • Service Type: HTTPS or HTTP

aFlex Code

when HTTP_REQUEST {
	if { [HTTP::host] eq "tw.test.website.com"} {
		if { [HTTP::uri] starts_with "/story" } {
			# do nothing
		} elseif { [HTTP::uri] starts_with "/maple" } {
			# do nothing
		} elseif { [HTTP::uri] starts_with "/uri" } {
			# do nothing
		} else {
			if { [TCP::local_port] eq 80 } {
				HTTP::redirect "http://tw.website.com[HTTP::uri]"
			} else {
				HTTP::redirect "https://tw.website.com[HTTP::uri]"
			}
		}
	}
}
a10/slb/aflex/http/redirect-domain-uri.txt · 上一次變更: 2014/12/08 16:50 由 jal
上一頁 | 下一頁 | 回首頁 | RSS Feed | Facebook