# Traefik v3 - Redirect to externalName host drops full url path

**URL:** <https://community.traefik.io/t/traefik-v3-redirect-to-externalname-host-drops-full-url-path/29362>\
**Category:** Traefik v3 (latest)\
**Tags:** kubernetes-crd\
**Created:** [November 27, 2025, 6:50am UTC](https://community.traefik.io/t/traefik-v3-redirect-to-externalname-host-drops-full-url-path/29362 "2025-11-27T06:50:15Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![colinwalker](https://avatars.discourse-cdn.com/v4/letter/c/59ef9b/32.png) [@colinwalker](https://community.traefik.io/u/colinwalker)\
**Post date:** [November 27, 2025, 6:50am UTC](https://community.traefik.io/t/traefik-v3-redirect-to-externalname-host-drops-full-url-path/29362/1 "2025-11-27T06:50:15Z")

</div>

Hello everyone,

I am looking into migrating from ingress-nginx to traefik-v3 using kubernetes-crd provider as we have quite some requirements. At first sight, I thought traefik would be a suitable replacement but I am facing quite a lot of issues implementing what seems like “basic“ functionality from ingress-nginx.

In my setup I have an application that calls itself on its own domain on a specific prefixed path. The goal here is to let the “controller” strip the prefix and redirect the remaining path to a separate host. (I know this should just be solved in the application itself but currently this is not an option)

e.g.

[https://colin.walker/admin/api/token](https://colin.walker/admin/api/token)

should be redirected to

[https://admin.colin.walker/api/token](https://admin.colin.walker/api/token)

I managed to deploy the following traefik resources;

```auto
apiVersion: traefik.io/v1alpha1
kind: IngressRoute
metadata:
  name: proxy-admin-page
  namespace: default
spec:
  entryPoints:
    - websecure
  routes:
    - match: Host(`colin.walker`) && PathPrefix(`/admin`)
      kind: Rule
      services:
        - name: external-admin-page
          port: 443
  tls:
    secretName: default-tls

```

Alongside;  
`apiVersion: v1`  
`kind: Service`  
`metadata:`  
` name: external-admin-page`  
` namespace: default`  
`spec:`  
` type: ExternalName`  
` externalName: admin.colin.walker`  
` ports:`  
` - port: 443`  
` targetPort: 443`

I did not even implement the removal of `/admin` in the path yet, it just drops the whole path regardless and sends a request to `https://admin.colin.walker:443` when using the external-name reference. Am I attempting something that is inherently not possible with Traefik ?

Kind regards,  
Colin Walker

---

<div class="post-metadata">

**Author:** ![colinwalker](https://avatars.discourse-cdn.com/v4/letter/c/59ef9b/32.png) [@colinwalker](https://community.traefik.io/u/colinwalker)\
**Post date:** [November 27, 2025, 8:37am UTC](https://community.traefik.io/t/traefik-v3-redirect-to-externalname-host-drops-full-url-path/29362/2 "2025-11-27T08:37:22Z")

</div>

Managed to get a workaround using the following; This now preserves the path that has been provided in the original request but, does not yet forward / keep all original headers.

```auto
apiVersion: traefik.io/v1alpha1
kind: Middleware
metadata:
  name: redirect-admin
  namespace: default
spec:
  redirectRegex:
    regex: ^https://colin.walker/(.*)
    replacement: https://admin.colin.walker/${1}

```

```auto
apiVersion: traefik.io/v1alpha1
kind: Middleware
metadata:
  name: strip-admin
  namespace: default
spec:
  stripPrefix:
    prefixes:
      - "/admin"

```

```auto
apiVersion: traefik.io/v1alpha1
kind: IngressRoute
metadata:
  name: proxy-admin
  namespace: default
spec:
  entryPoints:
    - websecure
  routes:
    - match: Host(`colin.walker`) && PathPrefix(`/admin`)
      kind: Rule
      middlewares:
        - name: strip-admin
        - name: redirect-admin
      services:
        - name: placeholder-svc
          port: 8080
  tls:
    secretName: default-tls

```
