Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.


#3 Multiple Websites

kathy scanlon
API (7)
Michael Glazer

The maintenace of multiple website s become easy with
XPC since file maintenance is not a significant issue.

The process in "binding" a domain to XPC is very
simple. It is the first thign an administrator will do
when they run XPC.

They call the setup.php file (or go to the /admin/
directory (as the directory index file)). The
setup.php file includes three action (three files).

1. enter domain specific information

2. enter "master" administrators information.

3. The third and last view prompts the admin setting
up the XPC website to validate the settings that were
created when the second page was submitted and to go
back and edit them or to continue and submit ther
request and build all the necessary XPC tables.

NOTES: Multiple web sites and "domain binding" are
based on the browser environment and the current
domain config files that have been setup or created by
the XPC master admin.

Each time a new domain setup is run a new
domain_config.php file is created (can be edited at
any time).

The domain becomes a unique value that is reused. We
use it to differentiate similar tables as a prefix
variable in front of all table names like so:

The XPC file that generates all XPC web pages will
always call the same Global Functions that are
necessary for each and every page.

In regards to this documnet the function to acquire
the currentDomain parse the enviromental $HTTP_HOST
variable and exclued the www. part for consistency.

This does mean that in the domain_config.php file the
domain must be named withotu a www. part.

There are dual reasons for this.
1. a visitor might or might not type the www. so
we force consistency on the administrator rather then
an unexpected visitor.
2. This enables subdomains to be usd as new XPC
sites and be considered a unique $domain variable in
our currentDomain function.

This is a powerful and useful feature. All that is
required is to have a catchall *
subdomain so that anything typed before the domain
name will send the user to the same directory.

When the currentDomain function is run from the
default XPC page (that every URL is forced to run).
the $domain = currentDomain();

We then use our $domain variable to define which
$domain"._config.".php file we will include nased on
the curren domain in the browser.


  • Michael Glazer
    Michael Glazer

    • summary: Multiple WebStes --> Multiple Websites