• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

folder directory for sub domain web desige

 
David Nelson
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
how to mapping my folder directory structure to sub domain.

e.g. www.mywebsite.com has several sub domains: photo.mywebsite.com, club.mywebsite.com, music.mywebsite.com, ... do i need to create corresponding directory when i developing? what directory structure should i have.

these subdomain still share the same resources, such as database connection..

Cheers.

David
 
John Smith
Ranch Hand
Posts: 61
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Obviousy this is a super open ended question but I would suggest:

WEB-INF/club
WEB-INF/music
WEB-INF/photo
WEB-INF/common

Write yourself a class that has an instance of a database connection as a private member variable and stick it in the common, when you need to use the database from anywhere just grab that instance
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64721
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Just creating folders, especially ones hidden behind WEB-INF isn't going to do a thing for you in this respect. You need to configure your sub-domains at the server and the servlet container level.

I can't help you with the server setup, but once you have the sub-domains configured, look into the concept of "virtual hosts". In Tomcat, you would configure these in server.xml using the <Host> elements.
 
David Nelson
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks so much for your reply, need to try it ;-)
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic