2023-05-12 开启多语言插件支持……

apache 301 重定向配置

apache 苏 demo 2237℃ 0评论

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 重定向配置

   如果本篇文章对您有帮助,欢迎向博主进行赞助,赞助时请写上您的用户名。
支付宝直接捐助帐号oracle_lee@qq.com 感谢支持!
喜欢 (0)or分享 (0)