Home
Support Forums

How to create and deploy

Hello!

Background information

  • Currently, I have a domain name (that i bought myself). Let’s call the domain name XXX.com
  • The domain name is managed by Netlify. I have published a netlify site with that domain name with an existing Github repo.

I would like to:

  1. Create a subdomain XXX.com/notes. When users access notes.XXX.com, they should be redirected to XXX.com/notes.
  2. Then, I want to build a netlify site with the URL XXX.com/notes.

How do I do 1 and 2?

What I’ve tried to do
In the same repo which I build for the base domain, I created a /notes folder, then created a separate site on Netlify and built the /notes folder. However, when I go to XXX.com/notes, the page does not appear.

Thank you!

This approach would be not easily possible, but here’s the workflow that you’d need:

You need to cd to the /notes site, build it, cd to the main site, build that, and then cp the contents of the publish folder of /notes site into the publish folder of main site. You need to generate a build command to handle this situation.

An alternative would be to create another website and add rewrite rules: Redirects and rewrites | Netlify Docs

Thanks for the quick reply! I’ve decided to just combine the 2 sites into the same repo - an easier, no-brainer option.