# Url encoding causing 404 not found

**URL:** <https://community.traefik.io/t/url-encoding-causing-404-not-found/7881>\
**Category:** Traefik v2\
**Tags:** file\
**Created:** [September 25, 2020, 4:40am UTC](https://community.traefik.io/t/url-encoding-causing-404-not-found/7881 "2020-09-25T04:40:46Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![pvb](https://avatars.discourse-cdn.com/v4/letter/p/c68b51/32.png) [@pvb](https://community.traefik.io/u/pvb)\
**Post date:** [September 25, 2020, 4:40am UTC](https://community.traefik.io/t/url-encoding-causing-404-not-found/7881/1 "2020-09-25T04:40:46Z")

</div>

Dear All,  
We have scenario where end user makes request  
http://TRAEFIK\_HOST/myexample/tenant1/docs and this needs to be converted to  
[http://ServiceEndpoint](http://ServiceEndpoint):PORT/docs?tenant=tenant1

we have configured traefik as below:

```auto
http:
  routers:
    docroute:
      rule: "PathPrefix(`/myexample/`)"
      service: docs
      middlewares: 
      - replacepathx@file
  services:
    docs:
      loadBalancer:
        servers:
        - url: "http://localhost:8011"
  middlewares:
    replacepathx:
      replacePathRegex:
        regex: "^/myexample/(.*)/docs/"
        replacement: "/docs?tenant=$1"

```

While forwarding the request, URL is getting encoding and it becomes  
[http://localhost:8011/docs%3Ftenant=tenant1](http://localhost:8011/docs%3Ftenant=tenant1)

This is causing 404 not found exception.

How to avoid encoding of '?' while forwarding the request.

Please help.

thanks and regards,  
Vijaya Bhaskar

---

<div class="post-metadata">

**Author:** ![HannesDB](https://avatars.discourse-cdn.com/v4/letter/h/a587f6/32.png) [@HannesDB](https://community.traefik.io/u/HannesDB)\
**Post date:** [November 9, 2022, 12:26pm UTC](https://community.traefik.io/t/url-encoding-causing-404-not-found/7881/2 "2022-11-09T12:26:01Z")

</div>

Hi @pvb, were you able to fix this issue? I'm having a similar issue where url encoding is undesirable.
