# Full URL redirection: domain + path + query, how do I do it?

**URL:** <https://discourse.haproxy.org/t/full-url-redirection-domain-path-query-how-do-i-do-it/534>\
**Category:** Help!\
**Created:** [August 2, 2016, 5:41pm UTC](https://discourse.haproxy.org/t/full-url-redirection-domain-path-query-how-do-i-do-it/534 "2016-08-02T17:41:04Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![JohnJonson](https://avatars.discourse-cdn.com/v4/letter/j/bc79bd/32.png) [@JohnJonson](https://discourse.haproxy.org/u/JohnJonson)\
**Post date:** [August 2, 2016, 5:41pm UTC](https://discourse.haproxy.org/t/full-url-redirection-domain-path-query-how-do-i-do-it/534/1 "2016-08-02T17:41:04Z")

</div>

I use HAProxy 1.5.14 with CentOS 7.

For a while I have been redirecting stuff using a map file like this:

```
domain1.com https://somedomain.net/path
domain2.com/path https://somedomain.net/path2?option=10
..and so on..

```

Then in the frontend I do:

`http-request redirect location %[base,map_beg(/etc/haproxy/redirections.map)] code 302 if { base,map_beg(/etc/haproxy/redirections.map) -m found }`

And this has been working like a charm, however I’m facing an issue that I do not know how to solve, I have to redirect a few URLs now that contain parameters (domain + path + query) IE:

```
domain3.com/path?optiona=1&optionb=2 https://yetanotherdomain.net/something?option=10
domain4.oreg/home?lol=1 https://yetanotherdomain.net/something?option=15

```

I tried using:

`http-request redirect location %[url,map_beg(/etc/haproxy/redirections.map)] code 302 if { url,map_beg(/etc/haproxy/redirections.map) -m found }`

But it didn’t work.

I have searched on Google up and down right and left and after a week I haven’t been able to find a solution for this issue.

Does any kind soul out there know a way to achieve this?

Thanks in advance.

---

<div class="post-metadata">

**Author:** ![JohnJonson](https://avatars.discourse-cdn.com/v4/letter/j/bc79bd/32.png) [@JohnJonson](https://discourse.haproxy.org/u/JohnJonson)\
**Post date:** [August 9, 2016, 3:58pm UTC](https://discourse.haproxy.org/t/full-url-redirection-domain-path-query-how-do-i-do-it/534/2 "2016-08-09T15:58:21Z")

</div>

Hi, no one knows how to do this?

Am I the only one who would ever attempt to do that?

Am I doing something that doesn’t make sense?

---

<div class="post-metadata">

**Author:** ![JohnJonson](https://avatars.discourse-cdn.com/v4/letter/j/bc79bd/32.png) [@JohnJonson](https://discourse.haproxy.org/u/JohnJonson)\
**Post date:** [September 4, 2016, 9:17pm UTC](https://discourse.haproxy.org/t/full-url-redirection-domain-path-query-how-do-i-do-it/534/3 "2016-09-04T21:17:09Z")

</div>

Help? no one?

No one knows/have ever tried to do this?
