# Redirect URL - domain and path using HAProxy 1.6

**URL:** <https://discourse.haproxy.org/t/redirect-url-domain-and-path-using-haproxy-1-6/8570>\
**Category:** Help!\
**Created:** [April 3, 2023, 6:20pm UTC](https://discourse.haproxy.org/t/redirect-url-domain-and-path-using-haproxy-1-6/8570 "2023-04-03T18:20:57Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![PLeeman](https://avatars.discourse-cdn.com/v4/letter/p/13edae/32.png) [@PLeeman](https://discourse.haproxy.org/u/PLeeman)\
**Post date:** [April 3, 2023, 6:20pm UTC](https://discourse.haproxy.org/t/redirect-url-domain-and-path-using-haproxy-1-6/8570/1 "2023-04-03T18:20:58Z")

</div>

I’ve been asked to setup a redirect based on a path where the destination will be a different domain and path. I’ve used path\_beg successfully for other redirects where the domain is changing but the path is staying the same, but I can’t get my head around how to get a full URL redirect to work.

The aim is to redirect [https://subdom.domain.com/app1/sub\_page/f?p=13000:101](https://subdom.domain.com/app1/sub_page/f?p=13000:101) to [http://domain2.com/path/page.html](http://domain2.com/path/page.html).

I need to do the redirect based on /sub\_page/f?p=13000:101 (or part of that) as /app1/other\_sub\_page is up and running.

Currently using HAProxy 1.6 (will be looking to upgrade, but don’t have time at the moment)

Any help appreciated.  
Pete.
