Trailing slash on proxy creates problem with assets and relative paths

Hi everyone, I have followed the great guide on how to use proxies to link a section of one repository to another. Everything works as expected but I have an issue with relative paths.

Here is the structure:

Repository A
Contains my main website with custom domain (
Has a proxy that rewrites to

Repository B
Contains my static blog page.
I have deployed the blog to the subfolder /blog

The problem is with the assets on Repository B.

Solution 1: Using absolute paths
If I use absolute paths for all the assets ( everything works fine. BUT if someone happen to visit directly he will get CORS issues as will try to access assets on
I’m aware that nobody is supposed to be visiting the repository directly, but I don’t like to leave a broken page around.

Solution 2: Using relative paths
If I use relative paths for all the assets (./image.jpg or image.jpg) it works only when visiting the blog using a trailing slash If the relative paths includes the subfolder (./blog/image.jpg or blog/image.jpg) it works only when visiting the blog without a trailing slash
I’d expect to be redirected to or the other way around, but for some reasons it doesn’t work that way. I can’t find a solution that works in both cases (except absolute paths).

So my question is: what would be the best approach for this kind of proxy issues?

Many thanks!

You should try using Base Paths: HTML base tag

If it doesn’t work, we would need to know the site name.

1 Like

Thank you! I’m not sure I understand how to use the base tag to fix this, but I’ll look into it.

1 Like