目錄表

Redirect to new domain

Requirement

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]"
			}
		}
	}
}