如果我在lighttpd中有以下域:
domain1.com
domain1.co.uk
domain2.com
domain2.co.uk
我如何将所有这些redirect到“domain.com”?
即:
domain1.co.uk/some-path/redirect到domain.com/some-path/和
domain2.com/some-other-path/redirect到domain.com/some-other-path/
谢谢。
就像是:
$HTTP["host"] =~ "firsthost.example.com|secondhost.example.com|otherhost.example.net" { url.redirect = ( "^/(.*)" => "http://realdomain.example.org/$1" ) }
应该工作 – 如手册页所述;)
使用lighttpd文档中提到的mod_redirect 。 有很多例子可以适应。