# Traefik: services can no longer access assets when stripping first prefix (how to set base url)

**URL:** https://community.traefik.io/t/traefik-services-can-no-longer-access-assets-when-stripping-first-prefix-how-to-set-base-url/27187
**Category:** Traefik v3 (latest)
**Tags:** kubernetes-ingress
**Created:** [April 13, 2025, 9:33pm UTC](https://community.traefik.io/t/traefik-services-can-no-longer-access-assets-when-stripping-first-prefix-how-to-set-base-url/27187 "2025-04-13T21:33:23Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![SpiderUnderUrBed](https://sea2.discourse-cdn.com/flex020/user_avatar/community.traefik.io/spiderunderurbed/32/10282_2.png) [@SpiderUnderUrBed](https://community.traefik.io/u/SpiderUnderUrBed)
#### Post date: [April 13, 2025, 9:33pm UTC](https://community.traefik.io/t/traefik-services-can-no-longer-access-assets-when-stripping-first-prefix-how-to-set-base-url/27187/1 "2025-04-13T21:33:23Z")

</div>

```auto
apiVersion: traefik.io/v1alpha1
kind: Middleware
metadata:
  name: strip-first-prefix
  namespace: default
spec:
# replacePathRegex:
# regex: "^/[^/]+(.*)"
# replacement: "$1"
  stripPrefix:
    prefixes:
      #- "/dashboard"
      #- "/api"
      - "/gitea"
      - "/wordpress"
      - "/vaultwarden"
      - "/pdns"
      - "/glance"
      - "/immich"

```

So I have a issue. whenever I accessed all of my services via 192.168.1.22/wordpress for example. it forwarded that /wordpress to the actual wordpress domain, leading to page not found, however when i strip the initial proefix, i can access the base page, however, when lets say wordpress wants any css or assets, it will look at 192.168.1.22/assets which wont work, so basically, I need a way for sort of, emulate the url paths, so it wont take actual queries to places that dont exist and tries to access resources the incorrect way, i know siteURL exists for WP, but i want a catchall solution which helps my other services.

---

<div class="post-metadata">

### Author: ![bluepuma77](https://avatars.discourse-cdn.com/v4/letter/b/a9adbd/32.png) [@bluepuma77](https://community.traefik.io/u/bluepuma77)
#### Post date: [April 14, 2025, 5:21am UTC](https://community.traefik.io/t/traefik-services-can-no-longer-access-assets-when-stripping-first-prefix-how-to-set-base-url/27187/2 "2025-04-14T05:21:18Z")

</div>

That’s why sub-domains are best practice. Not every web application supports a custom path.

It’s [discussed like here](https://community.traefik.io/t/docmost-pathprefix/27164/2) about every other week.
