lighttpd更换域名后实现重定向
1、lighttpd要实现301重定向功能需要更改其配置文件
2、配置文件路径:
/etc/lighttpd/conf/kloxo/lighttpd.domain.com
3、修改该配置文件:
$HTTP["host"] =~ “^zairun.com$” {
url.redirect = ( “^/(.*)” => “http://www.zairun.com/$1")
}
$HTTP["host"] =~ “^www.zairun.com$” {
url.redirect = ( “^/(.*)” => “http://www.zairun.com/")
}
5另、直接LIGHTTPD地址重写规则
$HTTP["host"] =~ “(www.zairun.com|zairun.com)” {
url.redirect = ( “^/(.*)” => “http://www.zairun.com/$1")
}