我需要从特定域/路径到具有相同路径的其他域的重定向请求,例如
domain.com/foo/everything-> example.com/foo/everything
我认为需要使用url_reg
,但我不明白如何处理重定向,也许是这样吗?
acl redirect-foo url_reg -i ^domain.com\/foo\/*
http-request redirect code 301 location http://example.com/foo/ if redirect-foo
但是很明显这行不通,谢谢能帮助我的人
您可以使用以下代码段
acl host_match hdr(host) -i domain.com
acl path_match path_beg -i /foo/
http-request redirect code 301 location http://example.com/%[capture.req.uri] if host_match path_match
Acl在文档和以下博客文章中进行了描述。