lighttpd mod_rewrite 寫法
lighttpd mod_rewrite 的用法
$HTTP["host"] == "www.abc.com" {
server.document-root = "/var/www/www.abc.com/htdocs/"
}
如此所有連到 www.abc.com 的 doc root 都指到 /var/www/www.abc.com/htdocs/
$HTTP["host"] == "www.abc.com" {
url.redirect = ("^/(.*)" => "http://abc.roodo.com/$1" )
}
如此所有連到 http://www.abc.com 都會被轉變成 http://abc.roodo.com/ 的網址
像是 http://www.abc.com/fourm/index.php -> http://abc.roodo.com/fourm/index.php
virtual host
$HTTP["host"] == "www.abc.com" {
server.document-root = "/var/www/www.abc.com/htdocs/"
}
如此所有連到 www.abc.com 的 doc root 都指到 /var/www/www.abc.com/htdocs/
Mod_write
$HTTP["host"] == "www.abc.com" {
url.redirect = ("^/(.*)" => "http://abc.roodo.com/$1" )
}
如此所有連到 http://www.abc.com 都會被轉變成 http://abc.roodo.com/ 的網址
像是 http://www.abc.com/fourm/index.php -> http://abc.roodo.com/fourm/index.php
沒有留言:
張貼留言