• Post Reply Bookmark Topic Watch Topic
  • New Topic

Best approach for user sub-sites on parent site  RSS feed

Kevin P Smith
Ranch Hand
Posts: 362
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi guys

I wasn't sure where to post this so I went for the General forum, but it might not be a Java specific issue...

I'm looking to create a site that allows customers to setup their own customer sub-sites within my site.

Basically what I want it to do is if we have a site say http://www.myrandomsite.com where users can set up their sites which will have URLs like http://www.theshoppingcenter.com/janedoeclothes.

The way I was looking at it is to use a Filter that gets the URI and takes a substring from the last / (so that'd be janedoeclothes) it then does a DB query looking for a matching row in the site table where site_uri = 'janedoeclothes' and from there it gets the site.id and puts a Site object into session.
Each time you goto a page, the URI is checked again against the uri of the Site object in session, if it's the same as the site.uri stored nothing happens, if not then another DB query is ran looking for the new site.id.

Not the easiest to explain but just wondering IF anyone could understand what I'[ve written, would this be a 'decent' way of doing this or are there better?
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!