According to most SEO experts, a subdirectory like /blog
is the best place to host your blog. Hyvor Blogs supports multiple methods to host your blog in a subdirectory.
If you are already using Cloudflare for your domain, using Cloudflare Workers is by far the easiest method to host your blog in a subdirectory. You can set it up in a couple of minutes without writing a single line of code.
If your main website is built with a web framework like NextJS or Laravel, you can use the same framework to host your blog. You can set up your blog to be served directly from the framework and use a cache (filesystem, redis, etc.) to improve performance.
We currently have libraries for the following frameworks.
If your framework is not support, you can manually handle the requests and serve the blog from your framework using:
We recommend you to check out the code in the above packages to get an idea of how to serve the blog from your framework. If you need any help, please contact us.
If you are using a web server like Nginx or Caddy, you can use a reverse proxy to serve the blog from a subdirectory.