-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathREADME
More file actions
32 lines (23 loc) · 1.48 KB
/
README
File metadata and controls
32 lines (23 loc) · 1.48 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
codeigniter-multidomain
=======================
This is a simple replacement implementation of the Router class, allowing you to match against
domain names in addition to the already-present pathnames.
This will not be backwards-compatible with your existing config/router.php
Developed by Cameron Turner (kladiin@kladiin.net)
Released under a simplified BSD license - see source code files for details.
-----------------
routes.php format
-----------------
routes.php is relatively similar to the old routes.php format, however, it is not backwards-compatible.
$routes is now a 2-dimensional array. The first part of the array is a regex matching the domain
name, and the second is a regex matching the pathname. The values must be strings pointing to a
controller in the controllers/ directory.
See example_application/config/config.php for a very simple example.
In addition, without any routes set up, for an URL http://www.example.com/hi/foo/bar/method/param1,
the application will do the following:
* Check to see that controllers/www.example.com/hi is a directory - if it is then:
* Check to see that controllers/www.example.com/hi/foo is a directory - if it is then:
* Check to see that controllers/www.example.com/hi/foo/bar is a directory - if it is not then:
* Check to see that controllers/www.example.com/hi/foo/bar.php is a file - if it is, then use that as a controller
It will also run "common" controllers on any domain - these controllers should be put in the root
controllers/ directory.