| 1 |
# Rewrite rules for lighttpd |
|---|
| 2 |
|
|---|
| 3 |
server.modules += ( "mod_rewrite", "mod_redirect" ) |
|---|
| 4 |
|
|---|
| 5 |
# path to your zenphoto installation in the webroot |
|---|
| 6 |
# don't forget the trailing slash! |
|---|
| 7 |
var.zendir = "/zenphoto/" |
|---|
| 8 |
|
|---|
| 9 |
# change the hostname to match yours |
|---|
| 10 |
$HTTP["host"] =~ "my\.photosite\.com" { |
|---|
| 11 |
url.rewrite-once = ( |
|---|
| 12 |
"^"+zendir+"admin/?$" => "$0", |
|---|
| 13 |
"^("+zendir+"(albums|cache|themes|zp-core).*)$" => "$1", |
|---|
| 14 |
"^("+zendir+"\?.*)" = > "$1", |
|---|
| 15 |
"^("+zendir+"[a-z]+.php(\?.*)?)$" => "$1", |
|---|
| 16 |
|
|---|
| 17 |
"^"+zendir+"page/([0-9]+)/?$" => zendir+"index.php?page=$1", |
|---|
| 18 |
"^"+zendir+"page/([A-Z]a-z0-9\-_]+)/?$" => zendir+"index.php?p=$1", |
|---|
| 19 |
"^"+zendir+"(.*)/page/([0-9]+/)?$" => zendir+"index.php?album=$1&page=$2", |
|---|
| 20 |
|
|---|
| 21 |
# Rewrite rule addition for search |
|---|
| 22 |
"^"+zendir+"page/([A-Za-z0-9\-_]+)/([A-Za-z0-9\-_]+)/?$" => zendir+"index.php?p=$1&words=$2", |
|---|
| 23 |
"^"+zendir+"page/([A-Za-z0-9\-_]+)/([A-Za-z0-9\-_]+)/([0-9]+)/?$" => zendir+"index.php?p=$1&words=$2&page=$3", |
|---|
| 24 |
|
|---|
| 25 |
# Rewrite rule addition for archive-/date-search (needed to be separated because of the same structure) |
|---|
| 26 |
"^"+zendir+"page/([A-Za-z0-9\-_]+)/archive/([A-Za-z0-9\-_]+)/?$" => zendir+"index.php?p=$1&date=$2", |
|---|
| 27 |
"^"+zendir+"page/([A-Za-z0-9\-_]+)/archive/([A-Za-z0-9\-_]+)/([0-9]+)/?$" => zendir+"index.php?p=$1&date=$2&page=$3", |
|---|
| 28 |
|
|---|
| 29 |
"^"+zendir+"(.*)/image/(thumb|[0-9]{1,4})/([^/\\]+)$" => zendir+"zp-core/i.php?a=$1&i=$3&s=$2", |
|---|
| 30 |
"^"+zendir+"(.*)/image/([^/\\]+)$" => zendir+"zp-core/i.php?a=$1&i=$2", |
|---|
| 31 |
|
|---|
| 32 |
# Catch-all - everything else gets handled in PHP for compatibility. |
|---|
| 33 |
"^"+zendir+"(.*)/?$" => zendir+"index.php?album=$1" |
|---|
| 34 |
) |
|---|
| 35 |
|
|---|
| 36 |
url.redirect = ( |
|---|
| 37 |
"^"+zendir+"admin/?$" => "http://%0"+zendir+"zp-core/admin.php", |
|---|
| 38 |
) |
|---|
| 39 |
} |
|---|