I am currently running one website where I host multiple "projects". One of these projects is now basically finished and I want to run this project on it's own domain.
I am running my main website on my own Synology server and I own a domain name for that site. I now want to buy a seperate domain for my new (finished) project. Since I only have one server at home I want to host both websites on that server. I had the following (probably terrible but I'm not sure) idea:
I put my finished project in its own seperate folder (with it's own index.php etc.) and I will link my newly bought domain name to my server. Then I check on my root index.php whether the user typed in "www.mainwebsite.com" in which case nothing happens, or if the user typed "www.seperateproject.com" I will redirect them to "finishedproject/index.php".
I am very certain that there are flaws in this system but It's the first (and easiest) thing that came to my mind. How will this e.g. influence my SEO?
I'm looking forward to hearing your opinions and if something is unclear, please let me know :)