Hello,
We're hosting Metabase on our platform and exposing it on a subpath e.g. https://mydomain.com/metabase/
, configured with the MB_SITE_URL
variable as per Environment variables | Metabase Documentation .
All is working well and fine, except for 2 issues I've identified so far that seem to be caused by Metabase's URL rewrite rules:
when formatting a table's column as hyperlink, the URL gets rewritten from e.g. https://mydomain.com/item/<id>
to https://mydomain.com/metabase/item/<id>
(inserting the subpath to my hyperlink's target URL)
when including a filter on a publicly shared question, the filter or the URL https://mydomain.com/metabase/public/question/<uuid>?mydatefilter=2025-06-01
is not applied to the question, so that I'm suspecting that the query string is not processed (not sure how to verify that though). The filter widget is displayed on the publicly shared question, but selecting a date there is also not applied to the query.
I've tested the same on a local instance of metabase on my machine using docker, and could confirm that identical queries behave differently on http://localhost:3000/ and on https://mydomain.com/metabase/ .
Has anyone else ever met this, found a workaround, and/or should I create a bug report on Github? It may be related to that 2-year-old bug .
Thanks,
Simon
TonyC
June 4, 2025, 11:46am
2
Yeah metabase doesn't directly support running in a subpath scenario. It works but the overall link situation is odd. There is a bug opened about this with some information of what works and what doesn't work. For reference
opened 12:04AM - 20 May 23 UTC
Type:Bug
Priority:P3
Embedding/
.Team/Embedding
### Describe the bug
Wanted to make an entire issue regarding links:
Overa… l situation:
made a dashboard that has:
link cards to an internal dashboard and an internal question
link cards to an absolute url and a relative url
link card to the same Metabase URL of the second card, but as an absolute URL instead of a URL that was generated with autocomplete
a table with absolute and relative urls, and also urls that take you to Metabase resources (both absolute and relative)

Situation 1:
go to that dashboard inside Metabase (not embedding)
- clicking on card link: opens in new tab the card
- clicking on dashboard link: opens in new tab the dashboard
- clicking on absolute url: opens in new tab the absolute url
- clicking on relative url: opens a non-existing resource (localhost:9090/www.google.com doesn't exist)
- clicking on the absolute URL that takes you to a Metabase resource: same as the second link
- clicking on the table on absolute url: opens in new tab the absolute url
- clicking on the table on relative url: opens a non-existing resource (localhost:9090/www.google.com doesn't exist)
- clicking on the table on the absolute question url: opens in the same tab the question
- clicking on the table on the absolute dashboard url: opens in the same tab the dashboard
- clicking on the table on the relative dashboard url: opens in the same tab the dashboard URL but encoding the url, so it will return a 404: /dashboard%2F1-abc
Situation 2 (testing with https://github.com/metabase/sso-examples):
go to that dashboard from within a full app embedding (Metabase runs on the root path)
- clicking on card link: opens new tab (escapes embedding)
- clicking on dashboard link: opens new tab (escapes embedding)
- clicking on absolute url: opens new tab
- clicking on relative url: opens new tab (escapes embedding), leads to a non-existent resource
- clicking on the absolute URL that takes you to a Metabase resource: opens new tab (escapes embedding)
- clicking on the table on absolute url: opens new tab
- clicking on the table on relative url: opens same tab, leading to a 404
- clicking on the table on the absolute question url: opens same tab, does not escape embedding
- clicking on the table on the absolute dashboard url: opens same tab, does not escape embedding
- clicking on the table on the relative dashboard url: opens in the same tab the dashboard URL but encoding the url, so it will return a 404: /dashboard%2F1-abc, does not escape embedding
Situation 3 (testing with https://github.com/paoliniluis/metabase-subpath):
go to that dashboard inside Metabase which is on a sub-path, but not embedded
- clicking on card link: opens in new tab
- clicking on dashboard link: opens in new tab
- clicking on absolute url: doesn't work, opens Metabase path in a new tab
- clicking on relative url: opens in a new tab a 404
- clicking on the absolute URL that takes you to a Metabase resource: opens in a new tab the resource
- clicking on the table on absolute url: opens in a new tab the absolute url
- clicking on the table on relative url: opens in the same tab, leading to a 404
- clicking on the table on the absolute question url: opens in the same tab, goes to the question
- clicking on the table on the absolute dashboard url: opens in the same tab, goes to the dashboard
- clicking on the table on the relative dashboard url: opens in the same tab the dashboard URL but encoding the url, so it will return a 404: /dashboard%2F1-abc
Situation 4 (testing with https://github.com/paoliniluis/metabase-subpath) :
go to that dashboard from within a full app embedding but Metabase is on a sub-path
works the same as situation 2
Situation 4:
go to that dashboard from a signed embedding
works the same as situation 5
Situation 5:
go to that dashboard from a public link
works the same as situation 1 and 3, but whenever you hit Metabase it asks for authentication
Situation 6 (a deviation from situation 3):
let's say that you have your app running on app.something.com, and metabase running in app.something.com/mb/
If you put a link to app.something.com, Metabase will open it on the same iframe, because it believes that it's the same application. Cause is https://github.com/metabase/metabase/issues/30895
### To Reproduce
NA
### Expected behavior
NA
### Logs
NA
### Information about your Metabase installation
```JSON
1.46.2
```
### Severity
P2
### Additional context
NA