Quantcast
Channel: HAProxy community - Latest topics
Viewing all articles
Browse latest Browse all 4729

Strip all expressions after domain name and redirect to domain only

$
0
0

@chomps wrote:

Hi, I have the following currently to redirect all traffic from domain.com to newdomain.com

acl host_redir_domain_com hdr(Host) -i domain.com
redirect prefix https://www.newdomain.com code 301 if host_redir_domain_com

This does the redirect just fine but if I pass the url in my browser domain.com/anyvar then it also redirects to newdomain.com/anyvar which does not exist in the new domain. I want anything after the / to be stripped away and only redirect to the new root domain (ie: newdomain.com only)

Could anyone please help me in achieving this. Your help is much appreciated.
Regards

(HA-Proxy version 1.5.18)

Posts: 2

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 4729

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>