apache 301,测试方法:
重启Apache后,使用curl -I old.libaocai.com验证下,返回的http状态值是301就是成功
<VirtualHost *:80> DocumentRoot "/data/www/www.libaocai.com" ServerName www.libaocai.com#实际的域名 <Directory /data/www/www.libaocai.com> AllowOverride all RewriteEngine on Order allow,deny Allow from all </Directory> </VirtualHost> <VirtualHost *:80> ServerName old.libaocai.com#需要跳转的域名 RedirectMatch permanent ^/(.*) https://www.libaocai.com/$1#跳转www.libaocai.com </VirtualHost>
转载请注明:苏demo的别样人生 » apache 301 重定向配置