Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/magento/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Redirect 重定向301多域名haproxy_Redirect_Haproxy - Fatal编程技术网

Redirect 重定向301多域名haproxy

Redirect 重定向301多域名haproxy,redirect,haproxy,Redirect,Haproxy,我有很多域名example.com、www.example.com、example.net、www.example.net等等 如何使用haproxy重定向所有这些域 目前,我可以通过以下方式按域名重定向域名: redirect prefix http://www.example.com code 301 if { hdr(host) -i example.fr } redirect prefix http://www.example.com code 301 if { hdr(host) -i

我有很多域名example.com、www.example.com、example.net、www.example.net等等

如何使用haproxy重定向所有这些域

目前,我可以通过以下方式按域名重定向域名:

redirect prefix http://www.example.com code 301 if { hdr(host) -i example.fr }
redirect prefix http://www.example.com code 301 if { hdr(host) -i www.example.fr }
但我只想用一行写上我所有的域名


关于

尝试一个if语句,检查主机是否不是www.example.com

redirect prefix http://www.example.com code 301 if !{ hdr(host) -i www.example.com }