Wildcard subdomain for the same site

In WordPress you can easily do this with sub-directories like example.com/user1

Sub-domain & URL Strategy
Having username.domain.com will prevent you in the future from having your own sub-domains like shop.example.com and will plague you if you wanted to use www.example.com or just http://example.com

Finally … what if some user wants to use expletives or special characters in their username <– not very good.

Traffic Load
Sub-domains are analysed (sic) by DNS servers around the world to figure out how to route traffic. If you want to use many sub-domains, this will also increase the load on your Apache web server as it tries to figure out what to do with someusername123456789.example.com

But to do this … you’d need to look at scripts, htaccess and rewrite rules and then, this question is probably better suited for a different forum.

Sub-directories are easy along with URL parameters
Its safe to say that sub-direcotries are easy (WordPress Author pages as example) and then WordPress can analyse this and determine what to do.

You can even use URL parameters like www.example.com/category/?user=username123456789

In summary — don’t do subdomains for usernames it can cause multiple headaches that you don’t want.

Leave a Comment