today we are going to discuss how to create multiple projects under single domain without compromising SEO or performance by using URL Rewrites.
imagine a scenario in which you have a .com domain with multiple sections such Blog, E-commerce along with homepage. traditionally you can create a single project & add everything into it, nothing wrong with that but this approach will give you problem during upscaling & maintenance of website because it will adds more complexity as you add more features or sections. To keep website architecture simple we can divide big website projects into small manageable projects. this small projects can be built using any web frameworks and this can also be a independent web servers in itself. for example, imagine a complex scenario in which you have a .com domain with homepage built using simple static HTML and you have blog section which is built using Astro JS & at the same time you have e-commerce section which is built using NextJS. all of this sections have their own path in domain address. Now the challenge here is how to to deploy all this small projects under same .com domain?
Solution to this is "URL Rewrites", this will be more theoretical video so stick with me till the end. let me explain you in simple way, URL rewrites can send user to different URL without modifying visible URL in address bar of web browser and it can also allow you to change path & query in url. This feature of Rewrites is built-in into many modern web frameworks or else you can use reverse proxy because under-the-hood Rewrites is a kind of reverse proxy.
let me show you real life example of how i use rewrites to manage my website. in my own website devershrx.com . i have multiple sections apart from homepage. homepage is made using nextjs, my blog section is made using docusaurus, and when i create new android app or game, i have dedicated a complete section for each & every apps, i use astro js to build web pages for apps. all this sections are their own mini projects deployed on vercel with their own vercel sub domain url. now to configure or deploy it with on my main domain i have created a separate project on vercel which is dedicated only to url rewrites & other configurations. we will call it root project which is deployed & configured with main domain that is deveshrx.com. inside this root project, i have created only one configuration file that is vercel.json, inside this file i will mention all my url rewites rules so that whenever this root project receives any HTTP request from user, this rewrite rules will tell vercel server where to send the request & location of destination. this is just the basics but with url rewrite feature you can do much more complicated url manipulation for more complex projects. i'm using vercel hosting for rewrites but another alternative is many web frameworks like nextjs, astro have built-in feature for rewrites which you can use, or you can use any other web hosting provider like netlify, firebase hosting, aws, or azure for creating rewrites.
now the important question is does it affect SEO or performance ? simple answer is, SEO is not affected because URL rewrites are server side configuration and everything happens in server side. in fact, SEO can be improved if you implement rewrites in proper way.
regarding the performance, generally it is not affected but it depends on how you configure servers in complex projects.