Posts Tagged ‘lighttpd rewrite add www’
lighttpd rewrite thêm www vào domain
29/11/2011
Leave a comment
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” )
}
Categories: PHP, Tin học, Web Server
lighttpd rewrite add www