| 1 |
mjordaan |
1 |
<?php namespace ProcessWire;
|
|
|
2 |
|
|
|
3 |
/**
|
|
|
4 |
* ProcessWire multi-domain configuration file (optional)
|
|
|
5 |
*
|
|
|
6 |
* If used, this file should be copied/moved to the ProcessWire installation root directory.
|
|
|
7 |
*
|
|
|
8 |
* ProcessWire 3.x, Copyright 2016 by Ryan Cramer
|
|
|
9 |
* https://processwire.com
|
|
|
10 |
*
|
|
|
11 |
*/
|
|
|
12 |
|
|
|
13 |
if(!defined("PROCESSWIRE")) die();
|
|
|
14 |
|
|
|
15 |
/**
|
|
|
16 |
* Multi-domain configuration: Optionally define alternate /site/ dirs according to host
|
|
|
17 |
*
|
|
|
18 |
* If used, this file should be placed in your web root and then edited as follows.
|
|
|
19 |
*
|
|
|
20 |
* This function returns an array that should be in the format where the array key
|
|
|
21 |
* is the hostname (including domain) and the value is the /site/ directory you want to use.
|
|
|
22 |
* This value must start with 'site-', i.e. 'site-domain' or 'site-something'. This is to
|
|
|
23 |
* ensure that ProcessWire's htaccess file can recognize and protect files in that directory.
|
|
|
24 |
*
|
|
|
25 |
* Note that if your site may be accessed at either domain.com OR www.domain.com, then you'll
|
|
|
26 |
* want to include entries for both, pointing to the same /site-domain/ directory.
|
|
|
27 |
*
|
|
|
28 |
* Each /site/ dir has its own /site/config.php file that should be pointing to a separate
|
|
|
29 |
* database. You shouldn't have two different /site/ dirs sharing the same database.
|
|
|
30 |
*
|
|
|
31 |
*/
|
|
|
32 |
function ProcessWireHostSiteConfig() {
|
|
|
33 |
return array(
|
|
|
34 |
/*
|
|
|
35 |
* Some Examples (you should remove/replace them if used).
|
|
|
36 |
* Just note that the values must begin with 'site-'.
|
|
|
37 |
*
|
|
|
38 |
*/
|
|
|
39 |
'mydomain.com' => 'site-mydomain',
|
|
|
40 |
'www.mydomain.com' => 'site-mydomain',
|
|
|
41 |
'dev.mydomain.com' => 'site-dev',
|
|
|
42 |
'www.otherdomain.com' => 'site-other',
|
|
|
43 |
|
|
|
44 |
/*
|
|
|
45 |
* Default for all others (typically /site/)
|
|
|
46 |
*
|
|
|
47 |
*/
|
|
|
48 |
'*' => 'site',
|
|
|
49 |
);
|
|
|
50 |
}
|
|
|
51 |
|