At the moment, my site is just a couple pages, but I’d like to take building it out more seriously. One of the things I’d like to do the most with my site is write game guides or about specific things like that. Right now the structure is domain.tld/game/guide page, but I was wondering if it would be cleaner if I used a subdomain like game.domain.tld/guide page.
I don’t know much about subdomains or how they function, but it seems mostly cosmetic to me? So, I’m assuming it’s mostly a personal preference sort of thing. But, maybe I’m wrong. Are there any pros/cons to using a subdomain? Or maybe specific best practices I’m not aware of.
personally ive decided to use subdomains for sections of my website that i want to be mini-sites of their own right, like my pixel clique isopals or my (currently unpublished) fanmade pokedex but its just a matter of preference
I love subdomains and generally prefer them to subdirectories - especially for the case @juette mentioned when you want something to feel more like its own thing than a section of your main site. To me, something about “game.domain.tld” says “this is where I put stuff about games and only stuff about games” more than “domain.tld/game” does. Subdomains also help keep web server configs cleaner IMO.
One thing to note is that you’ll need a wildcard SSL certificate (*.domain.tld) to cover all your subdomains, or you’ll need a separate SSL certificate for each subdomain. LetsEncrypt makes that a lot more reasonable than it used to be, but it’s still a little clunky.
Looks like I have been overwhelmingly influenced into adopting the use of subdomains! Thanks for all of the opinions, guys. I think the only con now is having to redirect the one (1) page that exists with the subfolder format. Will that be particularly hard? I think it’s been shared around a good bit and I don’t want to make it too difficult to find.
I have a page at domain/game/guide right now, but if I change to using subdomains it would be moved to game.domain/guide which I assume would break anywhere it has been linked before.
Currently, I just have a neocities site. I’ve been thinking about this sort of thing, because I’m planning to move to shared hosting, though. I’ll probably end up using NFS, but I’m open to recommendations!
When self-hosting, some web applications will run under a path prefix and some will just break. Getting a wildcard cert and subdomains for my home server made hosting easier.
Keep in mind that subdomains are treated by search engines as different websites, and cPanel hosting accounts will also show you traffic stats separately. So it’s best to use subdomains for separate projects that you don’t want to mix up. Or like I did in the past, for breaking off parts of a site that are so popular on their own that they swamp everything else in the traffic stats.
Interesting! Are there any specific downsides to search engines treating them as different websites? I’ve never actually looked into SEO related stuff.
Well… search engines queue each site for indexing separately. They treat external versus internal links differently. And they might group search results by site where it makes sense. They can’t do that if they think two otherwise related pages are part of different sites.
I also use subdomains for applications on my server that are not my website (like linkding, FreshRSS or Grafana). Additionally, I use subdomains for projects that need their own backend. Other than that, I try to keep stuff on the main domain, which is also the only one protected by Anubis because the rest is already behind some kind of login.