Home  >  Article  >  php教程  >  CodeIgniter针对lighttpd服务器URL重写的方法

CodeIgniter针对lighttpd服务器URL重写的方法

WBOY
WBOYOriginal
2016-06-13 09:02:041375browse

CodeIgniter针对lighttpd服务器URL重写的方法

 由于开发环境使用的是lighttpd服务器,我本机环境使用的是Apache配置,导致部署到开发机后,所有的链接地址全部跳转到首页。

分析了下,index.php/controller/function ,controller没有生效,应该是路由分发的缘故。

配置lighttpd配置的url重写规则:

1

2

3

4

5

url.rewrite-once = (

"/(.*)\.(.*)" => "$0",

"/(css|files|img|js|stats)/" => "$0",

"^/([^.]+)$" => "/index.php/$1"

)

另附Apache url重写规则:

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

重启lighttpd服务,ok!

Statement:
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