views:

72

answers:

2

Hi all,

I'm currently building a web application and I would like my users to have their own URLs to identify them. I could either do this using subdomains or using folders and am wondering what are the advantages and disadvantages of either one.

I really like the folder solution because my URL mapping would be fairly easy. I have read about auto-generating subdomains and one solution was to create virtual hosts and then restart my nginx. It's a solution but I would prefer not to have to restart my web server everytime a new account is created. If there are any other ways on how to do automated subdomain creation, that would be great as well!

Thanks!

A: 

Use something like mod_wsgi instead of cgi scripts, they allow you to use arbitrary URL configs (example: Django, web.py, Zope ...)

leoluk
@leoluk: From the tag, I suspect he is already using Django.
Manoj Govindan
Yep! My mistake! I'm using Django.
Tereno
+1  A: 

I think directories are the way to go. I believe it would be easier to adapt Django to the directories way much easier than to subdomains. And as one user commented you can avoid restarting your server each time.

I prefer to keep subdomains reserved for system use. Users should get their own directories instead. This is not a rule, just my preference.

Manoj Govindan
I would prefer folders as well because of the first point. But I'm curious why would Wordpress.com and blogspot use subdomains instead?
Tereno