apache多域名301跳转

centos apache多域名301跳转 ,具体做法:

在空间上加一个文件: .htaccess(注意h前的点不要漏了),记得放到网站主目录下

 

view source

print?

1RewriteEngine On
2RewriteCond %{HTTP_HOST} ^centoscn.com [NC,OR]
3RewriteCond %{HTTP_HOST} ^www.centoscn.com [NC]
4RewriteRule ^(.*)$ https://www.helloswift.com.cn/$1 [L,R=301]