DEV Community

Discussion on: Do you prefer subdomains or subdirectories?

Collapse
yoursunny profile image
Junxiao Shi

My main website uses subdirectory naming. For example, the blog is at yoursunny.com/t/ .
The reason was that, shared hosting accounts I used initially did not support subdomains.

I tend to use short directory names:

  • /t/: "tech blog", now it's more than tech contents
  • /p/: projects
  • /m/: "me", now it's contact information and social media posts

The structure was designed in 2006, although there has been changes during the 2017 rebuild. Most of the links in past 15 years are still working, thanks to redirects.

Scripts on this website are written in PHP so they can go into subdirectories easily.


When it comes to pages published from GitHub Actions, Node.js or Go servers, etc, it would be difficult to use subdirectories. My new domain ndn.today arranges contents in subdomains. I'm getting many emails about TLS certificate issuance.