CodeIgniter's method for rewriting the lighttpd server URL
Since the development environment uses the lighttpd server, my local environment uses the Apache configuration. After deploying to the development machine, All link addresses will jump to the home page.
After analysis, index.php/controller/function, controller does not take effect, it should be due to route distribution.
Configure url rewrite rules for lighttpd configuration:
1
2
3
4
5
|
url.rewrite-once = (
"/(.*).(.*)" => " ",
"/(css|files|img|js|stats)/" => " ",
"^/([^.] )$" => "/index.php/"
)
|
1
2
3
4
1
2
3
4
5
6
7
8
9
10
11
12
|
ProxyPreserveHost On
DocumentRoot "D:/Program Files/xampp/htdocs/xxx"
ServerName xxx.baidu.com
DirectoryIndex index.php
Options Indexes FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
|
5
|
url.rewrite-once = (
"/(.*).(.*)" => "$0",
"/(css|files|img|js|stats)/" => "$0",
"^/([^.] )$" => "/index.php/$1"
)
|
Apache url rewriting rules are also attached:
1
3
4
5
6
7
8
9
10
11
12
|
ProxyPreserveHost On
DocumentRoot "D:/Program Files/xampp/htdocs/xxx"
ServerName xxx.baidu.com
DirectoryIndex index.php
Options Indexes FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
|
Restart lighttpd service, ok!
http://www.bkjia.com/PHPjc/1014280.htmlwww.bkjia.comtruehttp: //www.bkjia.com/PHPjc/1014280.htmlTechArticleCodeIgniter’s method for lighttpd server URL rewriting. Since the development environment uses the lighttpd server, my local environment uses It is the Apache configuration that causes all...