abdu
June 18, 2020, 6:33pm
1
Hi,
So I want to host different sites under a single custom domain using subfolders.
site 1: customdomain.com/site1/
site 2: customdomain.com/site2/
…
I looked at the documentation and googled but didn’t really understand. Is this possible?
Thanks.
perry
June 19, 2020, 5:28pm
2
do you mean something like a monorepo, potentially?
abdu
June 19, 2020, 7:32pm
3
No, not something like this.
I’ve just added subdomains, and moved to other work. But I am curious how to host a gatsby site in domain.com/site .
Gatsby has a prefix option, but I couldn’t find the relevant setting in Netlify.
fool
June 24, 2020, 1:29am
4
You’d set the publish directory to be “dir”, put your build’s output files in “dir/site/index.html” in git, and you’re good to go !
You’ll want to make sure that matches with Gatsby’s expectation of where things go, and make sure that your single-page-app redirect rule:
…also targets that directory (probably something like /site/* /site/index.html 301!
if you wrote it manually)
1 Like
abdu
September 22, 2020, 2:23pm
5
Thanks @fool . Finally I’m getting back to this topic.
Do you mean changing the publish directory to something like: blog/public/ or blog/ ?
fool
September 22, 2020, 4:12pm
6
I mean, make gatsby output in /directory/subdirectory
(this is where your main index.html
should be), and set it to /directory
(which I guess should be empty, still not sure exactly what your goal is, but I think that would map) - so that we deploy /subdirectory/*
.