Home > Backend Development > PHP Tutorial > CodeIgniter method for lighttpd server URL rewriting_PHP tutorial

CodeIgniter method for lighttpd server URL rewriting_PHP tutorial

WBOY
Release: 2016-07-13 09:51:20
Original
1019 people have browsed it

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",

)
Apache url rewriting rules are also attached:
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
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...
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template