View Single Post

  #3 (permalink)  
Old 05-19-2008, 11:50 PM
nixcraft's Avatar
nixcraft nixcraft is offline
Never say die
User
 
Join Date: Jan 2005
Location: BIOS
My distro: Ubuntu
Posts: 1,035
Rep Power: 10
nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute
Default

url.redirect = ( "^/show/([0-9]+)/([0-9]+)$" => "http://www.example.org/show.php?isdn=$1&page$2",
"^/get/([0-9]+)/([0-9]+)$" => "http://www.example.org/get.php?isdn=$1&page$2" )

You need to activate required modules i.e. mod_redirect and mod_rewrite in lighttpd.conf
URL redirect can be done using url.redirect directive:

Code:
url.redirect = ( 
"^/home.html$"$" => "http://domain.com/news.php",
"^/index.html$" => "http://domain.com/news.php",
"^/index.htm$" => "http://domain.com/news.php",
"^/default.html$" => "http://domain.com/news.php",
"^/default.htm$" => "http://domain.com/news.php"
)
Rewrite rules always execute before redirect rules so add them first and followed by redirect rules in following format


Code:
url.rewrite-once = ( 
 "<regex>" => "<relative-uri>",
 "<regex>" => "<relative-uri>" 
)
Here is sample
Code:
url.rewrite-once = ( 
"^/download.html$" => "download.php",
"^/downloads([0-9]*)\.html(.*)$" => "download.php?view.$1"
)
You need to test them, usually not a big difference. Following will provider
more info

Docs:ModRewrite - lighttpd - Trac
__________________
Vivek | My personal blog
Linux Evangelist
Play hard stay cool
Reply With Quote