# Page Proxy Redirection

**URL:** <https://community.traefik.io/t/page-proxy-redirection/25490>\
**Category:** Traefik v3 (latest)\
**Tags:** middleware\
**Created:** [December 10, 2024, 1:54pm UTC](https://community.traefik.io/t/page-proxy-redirection/25490 "2024-12-10T13:54:05Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kitsunejasutin](https://sea2.discourse-cdn.com/flex020/user_avatar/community.traefik.io/kitsunejasutin/32/9643_2.png) [@Kitsunejasutin](https://community.traefik.io/u/Kitsunejasutin)\
**Post date:** [December 10, 2024, 1:54pm UTC](https://community.traefik.io/t/page-proxy-redirection/25490/1 "2024-12-10T13:54:05Z")

</div>

Basically I need to redirect the traffic from a base sub domain to a localhost instance with a different port and a sub path  
I have a local domain of nic.local and a subdomain of phpmyadmin.nic.local where I want to access the phpmyadmin web gui.  
phpmyadmin console is currently being served on `http://localhost:81/phpmyadmin`  
I place the link on the loadbalancer

```auto
servers:
  - url: "http://localhost:81/phpmyadmin"

```

But it redirects me on the `https://phpmyadmin.nic.local/dashboard` which ofc is not existing.

I used replacePath but it directs me to `https://phpmyadmin.nic.local:81/phpmyadmin` which results to 404 page.

Problems I encounter right now

1. It directs me to the localhost:81 instead of using the path `/phpmyadmin`
2. it appends the path to the subdomain when accessing

Desired output:

1. Access `phpmyadmin.nic.local` and get access to the `http://localhost:81/phpmyadmin`

Any help on redirect is a great start! Thank you!

---

<div class="post-metadata">

**Author:** ![Kitsunejasutin](https://sea2.discourse-cdn.com/flex020/user_avatar/community.traefik.io/kitsunejasutin/32/9643_2.png) [@Kitsunejasutin](https://community.traefik.io/u/Kitsunejasutin)\
**Post date:** [December 10, 2024, 2:12pm UTC](https://community.traefik.io/t/page-proxy-redirection/25490/2 "2024-12-10T14:12:08Z")

</div>

> [@Hiding sub path](https://community.traefik.io/t/hiding-sub-path/13030/4):
>
> Here is an example using docker-compose leveraging the addprefix middleware: version: "3.9" services: traefik: image: traefik:v2.5.2 command: - --api.insecure - --log.level=debug - --providers.docker.exposedByDefault=false volumes: - /var/run/docker.sock:/var/run/docker.sock:ro ports: - "8080:8080" - "80:80" whoami: image: traefik/whoami labels: - traefik.enable=true - traefik.http.routers.whoami.rule=Host(`whoami.lo…

By adding a prefix solved my problem

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex020/uploads/containo/original/2X/b/bd81ebdb578656e76e56ff3cc3eed021d3ba132d.png) [@system](https://community.traefik.io/u/system)\
**Post date:** [December 13, 2024, 2:12pm UTC](https://community.traefik.io/t/page-proxy-redirection/25490/3 "2024-12-13T14:12:42Z")

</div>

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.
