时时商务社区
标题:
CodeIgniter针对lighttpd服务器URL重写的方法
[打印本页]
作者:
xgnic
时间:
2018-2-14 05:45
本文实例讲述了CodeIgniter针对lighttpd服务器URL重写的方法。分享给大家供大家参考。具体实现方法如下:
由于开发环境使用的是lighttpd服务器,我本机环境使用的是Apache配置,导致部署到开发机后,所有的链接地址全部跳转到首页。
分析了下,index.php/controller/function ,controller没有生效,应该是路由分发的缘故。
配置lighttpd配置的url重写规则:
url.rewrite-once = (
"/(.*)\.(.*)" => "$0",
"/(css|files|img|js|stats)/" => "$0",
"^/([^.]+)$" => "/index.php/$1"
)
另附Apache url重写规则:
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!
希望本文所述对大家基于CodeIgniter的php程序设计有所帮助。
您可能感兴趣的文章:
实现在Windows下安装Lighttpd的方法
ubuntu lighttpd+webpy (fastcgi)配置方法
CentOS下Lighttpd Web服务器安装与配置方法
解析如何去掉CodeIgniter URL中的index.php
Codeigniter实现处理用户登录验证后的URL跳转
nginx支持codeigniter的pathinfo模式url重写配置写法示例
CodeIgniter框架URL路由总结
Nginx、Apache、Lighttpd禁止目录执行php配置示例
欢迎光临 时时商务社区 (http://bbs.4435.cn/)
Powered by Discuz! X3.2