Create an account

Very important

  • To access the important data of the forums, you must be active in each forum and especially in the leaks and database leaks section, send data and after sending the data and activity, data and important content will be opened and visible for you.
  • You will only see chat messages from people who are at or below your level.
  • More than 500,000 database leaks and millions of account leaks are waiting for you, so access and view with more activity.
  • Many important data are inactive and inaccessible for you, so open them with activity. (This will be done automatically)


Thread Rating:
  • 484 Vote(s) - 3.46 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Handle multiple sites through subdomains

#1
I'm trying to improve my skills in PHP by creating my own CMS infrastructure, probably based on a lightweight framework like FuelPHP.
Because I think it's better to have a goal, I would like to use this opportunity to build a multi site CMS.

It would be a CMS for a game.
Basically, here the workflow:

Somebody create an account on the main site (

[To see links please register here]

), then create a site for his server (

[To see links please register here]

). People from his server would then come to the subdomain and register to interact with the forum, the gallery, updating their account, etc.

Is using subdomains a correct approach ?
If I use a wildcard for my DNS, how must the vhost be configured to redirect on the correct folder based on the subdomain ? Can I not use a folder system for each site and use only one app to handle everything by just "passing" the subdomain as a variable to the app to tell it on which site I am ? Is it reliable ?

If in the future I want to propose custom domain names, is it possible with this approach ? I would only need to handle domain name registering myself and add a vhost configuration to redirect on the correct folder ?


I'm a little lost on the correct and most robust approach.

Today I have the domain name and I will take a little VPS for testing.

Thanks a lot for any help to guide me in the good direction and sorry for my broken english, I had trouble finding ressources on the Internet.
Reply

#2
> Is using subdomains a correct approach ?

It is a perfectly acceptable approach.

> If I use a wildcard for my DNS, how must the vhost be configured to redirect on the correct folder based on the subdomain ?

You use a default vhost to capture all the requests for the different hostnames.

Then you can shuffle them around using mod_rewrite or by examining the requested hostname at the application level.

> Can I not use a folder system for each site and use only one app to handle everything by just "passing" the subdomain as a variable to the app to tell it on which site I am ? Is it reliable ?

Yes.

The variable will already be available to your PHP via `$_SERVER['HTTP_HOST']`.

> If in the future I want to propose custom domain names, is it possible with this approach ?

Yes. There is no practical difference between a domain name and a subdomain as far as a webserver is concerned.

> I would only need to handle domain name registering myself and add a vhost configuration to redirect on the correct folder ?

You wouldn't even need a specific vhost configuration. Your default one would suffice.
Reply



Forum Jump:


Users browsing this thread:
1 Guest(s)

©0Day  2016 - 2023 | All Rights Reserved.  Made with    for the community. Connected through