Archive

Posts Tagged ‘lighttpd rewrite add www’

lighttpd rewrite thêm www vào domain

1/ Bạn muốn khi người dùng gõ:
yourdomain.com thì nó tự động chuyển http://www.yourdomain.com

$HTTP[“host”] =~ “^yourdomain\.com$”
{
url.redirect = ( “^/(.*)” => “http://www.yourdomain.com/$1” )
}

2/ và ngược lại ví dụ trên (muốn bỏ www tại url)

$HTTP[“host”] =~ “^www\.(.*)”
{
url.redirect = ( “^/(.*)” => “http://%1/$1” )
}