# Proxy to a subfolder in a container

**URL:** <https://community.traefik.io/t/proxy-to-a-subfolder-in-a-container/9688>\
**Category:** Traefik v2\
**Tags:** docker\
**Created:** [February 12, 2021, 2:51pm UTC](https://community.traefik.io/t/proxy-to-a-subfolder-in-a-container/9688 "2021-02-12T14:51:41Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![stefangries](https://sea2.discourse-cdn.com/flex020/user_avatar/community.traefik.io/stefangries/32/3371_2.png) [@stefangries](https://community.traefik.io/u/stefangries)\
**Post date:** [February 12, 2021, 2:51pm UTC](https://community.traefik.io/t/proxy-to-a-subfolder-in-a-container/9688/1 "2021-02-12T14:51:41Z")

</div>

I found many examples, on how to decide by a subfolder in a path which container to choose. What is not found is how to redirect to a subfolder. In my example I want to realize the following:

[https://domain.com/ab](https://domain.com/ab) -\> [https://mycontainer/kdav/ab](https://mycontainer/kdav/ab)  
[https://domain.com/gg/aa](https://domain.com/gg/aa) -\> [https://mycontainer/kdav/gg/aa](https://mycontainer/kdav/gg/aa)  
... and so on.

My current config of the container is:

traefik.http.routers.kdav.entrypoints=websecure,web  
traefik.http.routers.kdav.rule=Host(`domain.com`)  
traefik.http.routers.kdav.tls.certresolver|myresolver  
traefik.http.services.kdav.loadbalancer.server.port=9080

How to add the subfolder redirect?

---

<div class="post-metadata">

**Author:** ![cakiwi](https://sea2.discourse-cdn.com/flex020/user_avatar/community.traefik.io/cakiwi/32/3205_2.png) [@cakiwi](https://community.traefik.io/u/cakiwi)\
**Post date:** [February 12, 2021, 3:10pm UTC](https://community.traefik.io/t/proxy-to-a-subfolder-in-a-container/9688/2 "2021-02-12T15:10:39Z")

</div>

Hi @stefangries

You'll want to use the [AddPrefix - Traefik](https://doc.traefik.io/traefik/middlewares/addprefix/) middleware for that.

Bear in mind you may need to configure/change you backend so that /kdav ir not returned in any returned uris.
