手机
当前位置:查字典教程网 >编程开发 >php教程 >CodeIgniter针对lighttpd服务器URL重写的方法
CodeIgniter针对lighttpd服务器URL重写的方法
摘要:本文实例讲述了CodeIgniter针对lighttpd服务器URL重写的方法。分享给大家供大家参考。具体实现方法如下:由于开发环境使用的是...

本文实例讲述了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重写规则:

<VirtualHost *:80> ProxyPreserveHost On DocumentRoot "D:/Program Files/xampp/htdocs/xxx" ServerName xxx.baidu.com DirectoryIndex index.php <Directory "D:/Program Files/xampp/htdocs/xxx"> Options Indexes FollowSymLinks AllowOverride All Order allow,deny Allow from all </Directory> </VirtualHost>

重启lighttpd服务,ok!

希望本文所述对大家基于CodeIgniter的php程序设计有所帮助。

【CodeIgniter针对lighttpd服务器URL重写的方法】相关文章:

php 字母大小写转换的方法

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

php实现在服务器端调整图片大小的方法

php解析字符串里所有URL地址的方法

多php服务器实现多session并发运行

apache+mysql+php+ssl服务器之完全安装攻略

php生成年月日下载列表的方法

Yii实现自动加载类地图的方法

PHP文本数据库的搜索方法

php curl 获取https请求的2种方法

精品推荐
分类导航