Welcome to WebmasterWorld Guest from 54.144.243.34

Forum Moderators: coopster & jatar k

Will this weird application model work?

   
12:07 am on Jul 13, 2007 (gmt 0)

5+ Year Member



I'm getting started on a rather atypical PHP application. Tell me if this description sounds like a good idea or not:

Hundreds of domain names will be configured on a shared host to use the same document root directory. The PHP application files will look up a record in the database according to the domain name being requested. It's like name-based virtual hosting. Then according to that domain's configuration in our database, the right template files and data will be displayed.

Can any older, wiser developer reveal any unforeseen problems with this model?

Another thing, and maybe this should be a separate thread, but should I use a framework like CakePHP? Would such a framework play nicely with the sort of application I described above where the same code is used to generate vastly different websites? CakePHP or CodeIgniter are tempting because it sounds like they would rapidly speed up development, but maybe they have better application in another website. Also, CakePHP seems really slow. It takes like a quarter to half second just to produce a simple hello world kind of page with the default CakePHP configuration on my shared server.

Thanks for your advice,
Trevor

1:17 am on Jul 13, 2007 (gmt 0)

10+ Year Member



Consider these:

A) All sites are text/html with little to no unique php page building magic.

B) More than one site will require specially crafted templates or unique php page building magic to render.

If your sites are strongly type A, your idea is feasible.

If your sites are more strongly type B, I would not recommend that you handle them this way.

If most of the sites start out as type A, and only a *very* few grow to type B, then you can still proceed as planned for the type A's, and just get separate accounts for the type B's as needed.

You should consider .htaccess/ModRewrite as an alternative or supplement to your strictly php based solution. You could still keep them all in one account, but sub out the specific ones without having to build a framework for handling different domains in php.

2:46 am on Jul 13, 2007 (gmt 0)

5+ Year Member



Thank you for responding and for your suggestions. As most of the sites will use just three or four templates and plug in different data from MySQL, I'm thinking the "name-based virtual website" thing will be a viable solution.

Other thoughts and suggestions are still welcome.

Thanks,
Trevor

3:01 pm on Jul 13, 2007 (gmt 0)

WebmasterWorld Administrator coopster is a WebmasterWorld Top Contributor of All Time 10+ Year Member



I think sharing the same DOCUMENT_ROOT is going to cause issues in the future for you. Apache's Virtual Host setup is ideal for what you want to do. If you need to share common documents/templates/scripts in each site, then using a common repository and place that in the include path for each virtual site.

I think having a separate database for each site may also be a wise idea, but that is up to you and your design plans.

 

Featured Threads

My Threads

Hot Threads This Week

Hot Threads This Month