David Ma published a step‑by‑step guide on Nov. 14, 2025, showing how to host a blog in a subdirectory instead of a subdomain.
The method matters because a subdirectory can consolidate a site’s SEO value, simplify management and remove the need for separate DNS records, which many small‑business owners find burdensome.
Ma’s guide begins by recommending that the blog’s files live in a folder such as **/blog** under the main site’s root directory. Ma said the first step is to create the folder and copy the existing blog files into it.
Next, the guide walks readers through updating the web server’s configuration. For Apache servers, Ma said adding a rewrite rule to the site’s **.htaccess** file that redirects requests for */blog/* to the new folder while preserving existing URLs. For Nginx, Ma said the equivalent **location** block syntax.
The guide also covers updating internal links. Ma said using relative URLs wherever possible so that the same markup works whether the blog lives at the root or in a subdirectory. Ma said absolute URLs should be changed to include the **/blog** path.
Testing is a key part of the process. Ma said clearing the browser cache, checking that the home page loads, and verifying that individual posts retain their original URLs with the added **/blog** prefix. Ma said Google Search Console can be used to submit the updated sitemap.
Beyond the technical steps, Ma said industry research shows subdirectories often inherit the parent domain’s authority, which can lead to higher rankings than a separate subdomain would achieve. He links to a Search Engine Journal analysis that supports this claim.
The guide also addresses potential pitfalls. Ma said some content‑delivery networks cache URLs aggressively, so users may need to purge CDN caches after the migration. Ma said mixed‑content warnings can appear if the blog’s assets are still referenced with the old domain.
Overall, the tutorial is aimed at developers and site owners who want a single, cohesive URL structure without the overhead of managing a separate subdomain. Ma’s step‑by‑step approach makes the migration approachable for users with basic server‑administration experience.
The article is hosted on Ma’s personal blog at https://www.davidma.org/blog/2025-11-14-host-your-blog-on-a-subdirectory/.
“Using a subdirectory can simplify site management, consolidate SEO value, and avoid the technical overhead of maintaining a separate subdomain.”
What this means: As more small businesses and individual creators look to improve search visibility without expanding technical complexity, the subdirectory approach offers a low‑cost path to stronger SEO and easier maintenance, reinforcing a broader industry shift toward unified site architectures.




