Browse Source

less confusing/misleading on conditional backreference

git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-merge-1.4.x@955 152afb58-edef-0310-8abb-c4023f1b3aa9
svn/tags/lighttpd-1.4.11
Xuefer 17 years ago
parent
commit
1d97323652
  1. 31
      doc/rewrite.txt

31
doc/rewrite.txt

@ -53,28 +53,19 @@ query-string.::
"^/link/([a-zA-Z]+)" => "/index.php?link=$1" )
# request: http://www.domain.com/url/
# or request: http://any.domain.com/url/
# before write: /www/htdocs/url/
# after rewrite: /www/htdocs/domain.com/url/
# document-root=/www/htdocs/ %0=www.domain.com $1=url/
server.document-root = "/www/htdocs/"
$HTTP["host"] =~ "^.*\.([^.]+\.com)$" {
url.rewrite-once = ( "^/(.*)" => "/%0/$1" )
}
# the following example, is, however just simulating vhost by rewrite
# * you can never change document-root by mod_rewrite
# use mod_*host instead to make real mass-vhost
# request: http://abc.mass-serve-subdomain.com/url/
# before rewrite: /www/htdocs/url/
# after rewrite: /www/htdocs/mass-serve-subdomain.com/abc/url/
$HTTP["host"] =~ "^([^.]+)\.mass-subdomain\.com" {
server.document-root = "/www/htdocs/mass-subdomain.com"
url.rewrite-once = ( "^/(.*)" => "/%1/$1" )
}
# request: http://any.domain.com/url/
# before rewrite: REQUEST_URI="/www/htdocs/url/"
# and DOCUMENT_ROOT="/www/htdocs/" %0="www.domain.com" $1="url/"
# after rewrite: REQUEST_URI="/www/htdocs/domain.com/url/"
# still, you have DOCUMENT_ROOT=/www/htdocs/
# similar effect as above, except that you have multiply mass-subdomain now
server.document-root = "/www/htdocs/"
$HTTP["host"] =~ "^([^.]+)\.(mass-subdomain\.com|mass-subdomain\.net)" {
url.rewrite-once = ( "^/(.*)" => "/%2/%1/$1" )
$HTTP["host"] =~ "^.*\.([^.]+\.com)$" {
url.rewrite-once = ( "^/(.*)" => "/%0/$1" )
}

Loading…
Cancel
Save