-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrewrite_rule.txt
123 lines (113 loc) · 3.62 KB
/
rewrite_rule.txt
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
fastcgi
RewriteRule ^(.*)$ index.php?/$1 [L]
http://localhost/index.php/application/dwadaw
["PATH_INFO"]=>
string(19) "/application/dwadaw"
["SCRIPT_NAME"]=>
string(10) "/index.php"
["REQUEST_URI"]=>
string(29) "/index.php/application/dwadaw"
["QUERY_STRING"]=>
string(0) ""
["SCRIPT_FILENAME"]=>
string(28) "O:/Projects/NULAFX/index.php"
["PHP_SELF"]=>
string(29) "/index.php/application/dwadaw"
fastcgi
RewriteRule ^(.*)$ index.php?/$1 [L]
http://localhost/application/dwadaw?dawdwadw=dawdwa
["SCRIPT_NAME"]=>
string(10) "/index.php"
["REQUEST_URI"]=>
string(35) "/application/dwadaw?dawdwadw=dawdwa"
["QUERY_STRING"]=>
string(19) "/application/dwadaw"
["REDIRECT_QUERY_STRING"]=>
string(19) "/application/dwadaw"
["REDIRECT_URL"]=>
string(19) "/application/dwadaw"
["SCRIPT_FILENAME"]=>
string(28) "O:/Projects/NULAFX/index.php"
["PHP_SELF"]=>
string(10) "/index.php"
built-in server
http://localhost/index.php/application/dwadaw?dawdwadw=dawdwa
["REQUEST_URI"]=>
string(45) "/index.php/application/dwadaw?dawdwadw=dawdwa"
["SCRIPT_NAME"]=>
string(10) "/index.php"
["SCRIPT_FILENAME"]=>
string(28) "O:\Projects\NULAFX\index.php"
["PATH_INFO"]=>
string(19) "/application/dwadaw"
["PHP_SELF"]=>
string(29) "/index.php/application/dwadaw"
["QUERY_STRING"]=>
string(15) "dawdwadw=dawdwa"
built-in server
http://localhost/index.php?application/dwadaw?dawdwadw=dawdwa
["REQUEST_URI"]=>
string(45) "/index.php?application/dwadaw?dawdwadw=dawdwa"
["SCRIPT_NAME"]=>
string(10) "/index.php"
["SCRIPT_FILENAME"]=>
string(28) "O:\Projects\NULAFX\index.php"
["PHP_SELF"]=>
string(10) "/index.php"
["QUERY_STRING"]=>
string(34) "application/dwadaw?dawdwadw=dawdwa"
built-in server index.php
http://localhost/index.php/application/dwadaw?dawdwadw=dawdwa
["REQUEST_URI"]=>
string(45) "/index.php/application/dwadaw?dawdwadw=dawdwa"
["SCRIPT_NAME"]=>
string(10) "/index.php"
["SCRIPT_FILENAME"]=>
string(28) "O:\Projects\NULAFX\index.php"
["PATH_INFO"]=>
string(19) "/application/dwadaw"
["PHP_SELF"]=>
string(29) "/index.php/application/dwadaw"
["QUERY_STRING"]=>
string(15) "dawdwadw=dawdwa"
built-in server index.php
http://localhost/index.php?application/dwadaw?dawdwadw=dawdwa
["REQUEST_URI"]=>
string(45) "/index.php?application/dwadaw?dawdwadw=dawdwa"
["SCRIPT_NAME"]=>
string(10) "/index.php"
["SCRIPT_FILENAME"]=>
string(28) "O:\Projects\NULAFX\index.php"
["PHP_SELF"]=>
string(10) "/index.php"
["QUERY_STRING"]=>
string(34) "application/dwadaw?dawdwadw=dawdwa"
built-in server index.php
http://localhost/application/dwadaw?dawdwadw=dawdwa
["REQUEST_URI"]=>
string(35) "/application/dwadaw?dawdwadw=dawdwa"
["SCRIPT_NAME"]=>
string(19) "/application/dwadaw"
["SCRIPT_FILENAME"]=>
string(9) "index.php"
["PHP_SELF"]=>
string(19) "/application/dwadaw"
["QUERY_STRING"]=>
string(15) "dawdwadw=dawdwa"
built-in server index.php
http://localhost/?application/dwadaw?dawdwadw=dawdwa
["REQUEST_URI"]=>
string(36) "/?application/dwadaw?dawdwadw=dawdwa"
["SCRIPT_NAME"]=>
string(10) "/index.php"
["SCRIPT_FILENAME"]=>
string(28) "O:\Projects\NULAFX\index.php"
["PHP_SELF"]=>
string(10) "/index.php"
["QUERY_STRING"]=>
string(34) "application/dwadaw?dawdwadw=dawdwa"
总结:
如果PHP_SELF最后包含/,直接取QUERY_STRING
如有PATH_INFO、REDIRECT_URL,直接使用
如果QUERY_STRING带了问号,则取第一段使用
如果DOCUMENT_ROOT + SCRIPT_NAME不是有效的文件名则使用SCRIPT_NAME