forked from cynial/STBlog
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathroutes.php
More file actions
66 lines (61 loc) · 2.4 KB
/
Copy pathroutes.php
File metadata and controls
66 lines (61 loc) · 2.4 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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/*
| -------------------------------------------------------------------------
| URI ROUTING
| -------------------------------------------------------------------------
| This file lets you re-map URI requests to specific controller functions.
|
| Typically there is a one-to-one relationship between a URL string
| and its corresponding controller class/method. The segments in a
| URL normally follow this pattern:
|
| example.com/class/method/id/
|
| In some instances, however, you may want to remap this relationship
| so that a different class/function is called than the one
| corresponding to the URL.
|
| Please see the user guide for complete details:
|
| http://codeigniter.com/user_guide/general/routing.html
|
| -------------------------------------------------------------------------
| RESERVED ROUTES
| -------------------------------------------------------------------------
|
| There area two reserved routes:
|
| $route['default_controller'] = 'welcome';
|
| This route indicates which controller class should be loaded if the
| URI contains no data. In the above example, the "welcome" class
| would be loaded.
|
| $route['404_override'] = 'errors/page_missing';
|
| This route will tell the Router what URI segments to use if those provided
| in the URL cannot be matched to a valid route.
|
*/
$route['404_override'] = '';
$route['default_controller'] = "home";
$route['admin'] = "admin/login/index";
$route['page/(:num)'] = 'home/index/$1';
$route['posts/(:any)'] = 'posts/index/$1';
$route['category/(:any)'] = 'home/category/$1';
$route['comment/(:num)'] = 'comment/index/$1';
$route['trackback/(:num)'] = 'comment/trackback/$1';
$route['tag/(:any)'] = 'home/tag/$1';
$route['authors/(:any)'] = 'home/authors/$1';
$route['search'] = 'home/search';
$route['feed/(:any)'] = 'feed/index/$1';
//注意路由的顺序
$route['archives/(\d{4})'] = 'home/archives/$1/0/0/p1';
$route['archives/(\d{4})/(\d{2})'] = 'home/archives/$1/$2/0/p1';
$route['archives/(\d{4})/(\d{2})/(\d{2})'] = 'home/archives/$1/$2/$3/p1';
$route['archives/(\d{4})/p([0-9]+)'] = 'home/archives/$1/0/0/$2';
$route['archives/(\d{4})/(\d{2})/p([0-9]+)'] = 'home/archives/$1/$2/0/$3';
$route['archives/(\d{4})/(\d{2})/(\d{2})/p([0-9]+)'] = 'home/archives/$1/$2/$3/$4';
$route['pages/(:any)'] = 'pages/index/$1';
/* End of file routes.php */
/* Location: ./application/config/routes.php */