# Apache rewrite rule equivalent

**URL:** <https://discourse.haproxy.org/t/apache-rewrite-rule-equivalent/6425>\
**Category:** Help!\
**Created:** [March 31, 2021, 10:51pm UTC](https://discourse.haproxy.org/t/apache-rewrite-rule-equivalent/6425 "2021-03-31T22:51:57Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![porton](https://avatars.discourse-cdn.com/v4/letter/p/22d042/32.png) [@porton](https://discourse.haproxy.org/u/porton)\
**Post date:** [March 31, 2021, 10:51pm UTC](https://discourse.haproxy.org/t/apache-rewrite-rule-equivalent/6425/1 "2021-03-31T22:51:57Z")

</div>

Hi there, how would this Apache rewrite rule translate to HAProxy?

```auto
RewriteCond "%{QUERY_STRING}" !hint 
RewriteRule "endpoint/o/authz" "/endpoint/o/authz?hint=xyz" [QSA,PT]

```

I tried the following, but it does not seem to work.

```auto
acl is_not_hint path_reg !-m /endpoint/o/authz?hint
http-request replace-path /endpoint/o/authz?(.*) /endpoint/o/authz?hint=xyz\1 if is_not_hint

```

Any insigth will be appreceiated. Thanks!
