咨询热线:4006-75-4006
售前:9:00-23:30 备案:9:00-18:00 技术:7*24h
ECS Linux 服务器上的 Apahce 如何配置 301 重定向。
一般是通过修改 Apache 的站点配置文件来实现。
例如,要把域名 test.com,重定向到 www.landui.com,则需要修改 Apache 中站点的配置文件,添加 301 重定向的配置。
最主要就是以下配置:
ServerName test.com #绑定的域名test.comRedirectMatch permanent ^/(.*) http://www.landui.com/$1 #访问test.com,都跳转到www.landui.com
添加好 Apache 的配置后,重启 Apache 生效,然后访问 test.com,就会 301 跳转到 www.landui.com :