欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

CodeIgniter針對lighttpd服務(wù)器URL重寫的方法

 更新時間:2015年06月10日 10:19:44   作者:spring21st  
這篇文章主要介紹了CodeIgniter針對lighttpd服務(wù)器URL重寫的方法,涉及l(fā)ighttpd服務(wù)器配置及URL配置規(guī)則的相關(guān)技巧,需要的朋友可以參考下

本文實例講述了CodeIgniter針對lighttpd服務(wù)器URL重寫的方法。分享給大家供大家參考。具體實現(xiàn)方法如下:

由于開發(fā)環(huán)境使用的是lighttpd服務(wù)器,我本機環(huán)境使用的是Apache配置,導(dǎo)致部署到開發(fā)機后,所有的鏈接地址全部跳轉(zhuǎn)到首頁。

分析了下,index.php/controller/function ,controller沒有生效,應(yīng)該是路由分發(fā)的緣故。

配置lighttpd配置的url重寫規(guī)則:

url.rewrite-once = (
 "/(.*)\.(.*)" => "$0",
 "/(css|files|img|js|stats)/" => "$0",
 "^/([^.]+)$" => "/index.php/$1"
)

另附Apache url重寫規(guī)則:

<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服務(wù),ok!

希望本文所述對大家基于CodeIgniter的php程序設(shè)計有所幫助。

相關(guān)文章

最新評論