Redirect old domain to new domain with same directory structure by HAProxy

I am using mod_rewrite in .htaccess file to do the redirect old domain to new domain with same directory structure , here is example

RewriteEngine On
RewriteRule (.*) http://www.skstream.ws/$1 [R=301,L]

But i am wondering if there a rule that i can use for HAProxy configuration file it can do same purpose as mod_rewrite

1 answer

  • answered 2018-07-13 00:43 nuster cache server

    redirect prefix http://www.skstream.ws if { hdr_dom(host) -m str old.domain }