Apply another entrypoint by router-rule

Hi, I'm looking for a possibility to route a subfolder to anoter entrypoint (for hiding wp-admin for example). Is this possible, and when (with labels)

What do you can a "subfolder": a sub-domain or a path?

path: like -> and all its subfolders

so you can easy hide wp-admin, and restrict it to several ips for example...

You can use the PathPrefix matcher.

version: '3.7'

    image: traefik:v2.2
      - --log.level=INFO
      - --api
      - --providers.docker.exposedbydefault=false
      - --entrypoints.web.address=:80
      - 80:80
      - 443:443
      - /var/run/docker.sock:/var/run/docker.sock:ro
      traefik.enable: true

      # Dashboard
      traefik.http.routers.traefik.rule: Host(`traefik.localhost`)
      traefik.http.routers.traefik.entrypoints: web
      traefik.http.routers.traefik.service: api@internal

    image: containous/whoami:v1.5.0
      traefik.enable: true Host(`whoami.localhost`) web

      traefik.http.routers.app_admin.rule: Host(`whoami.localhost`) && PathPrefix(`/admin`)
      traefik.http.routers.app_admin.entrypoints: web

would a regex also do it?

traefik.http.routers.wordpressbackend.rule: HostRegexp(`^\/(?!wp-login|wp-admin).*\.php$$`)

Okay I found out that the rule works, but wp-admin is still accessible over the other entrypoint can I prevent that? Also the problem is, that it redirect to wp-login.php witch is in the root has to be the rule for this file to restrict?

Can you help me out with thisone? Traefik rule for accessing a special file inside a directory

I tried your way, it's not working as expected. The admin subfolder is still accessible on the normal entrypoint...