Need help Managing connection from non IpWhitelist

Hi,
I am trying to handle the case from when the connection does not comes from the IPWhitelist.

What I would like

  • sub1.domain.tld is public.
  • sub2.domain.tld is private (limited to specific ips), redirect (including url redirection) to sub1.domain.tld instead of a 403 Error.

What is Currently working
Currenlty I have everything working except for changing the URL from sub2.domain.tld to sub1.domain.tld, which give some errors in the loading on the page (because the site domain is wrong)

My Relevant Configs
sub1.domain.tld (The URL redirect middleware does not work as it's in a router and not service).

- traefik.http.routers.sub1.rule=Host(`sub1.domain.tld`)
- traefik.http.routers.sub1.entrypoints=sslweb
- traefik.http.services.sub1.loadbalancer.server.port=8080
- traefik.http.routers.sub1.middlewares=compress@docker,secure@docker,sub1_force_url@docker

# --- URL REDIRECTS --- Redirect to the URL if it not its URL (For Forbidden redirect).
- traefik.http.middlewares.sub1_force_url.redirectregex.regex=^https?://(?!sub1.domain.tld)(.*)
- traefik.http.middlewares.sub1_force_url.redirectregex.replacement=https://sub1.domain.tld

sub2.domain.tld

- traefik.http.routers.sub2.rule=Host(`sub2.domain.tld`)
- traefik.http.routers.sub2.entrypoints=sslweb
- traefik.http.services.sub2.loadbalancer.server.port=7575
- traefik.http.routers.sub2.middlewares=compress@docker,secure@docker,forbidden@docker,local_whitelist@docker

# --- FORBIDDEN REDIRECT --- Redirect the url if we have a 403 Forbidden error.
- traefik.http.middlewares.forbidden.errors.status=403
- traefik.http.middlewares.forbidden.errors.service=sub1
- traefik.http.middlewares.forbidden.errors.query=/

Local whitelist middleware

# --- MIDDLEWARE --- local_whitelist: Only Allow IPs from Docker/VPN Network!
- traefik.http.middlewares.local_whitelist.ipWhiteList.sourceRange=${LOCAL_WHITELIST}

Since the errors middleware redirect to a service, the redirection does not go through the router with the redirect middleware.
How can I get the non whitelisted IPs to redirect (including the URL) to another docker.

The Reason
My idea is to have a single url (sub2.domain.tld) as a startpage for my web browsers, and if I am connected to my local network, then I have my network dashboard (for example) with more private data on it, but if I am away from my local network, then I have another page (like searx, whoogle, weather etc..) with no private data on it.