准备把域名www.domain1.com 301跳转到www.domain2.com

在apache的域名配置文件(虚拟主机配置文件中),比如目录:/etc/httpd/conf.d/ 目录下的abc.conf是配置文件。

打开此文件

在其中设置:

<VirtualHost *:80>
  ServerName www.domain1.com
  RedirectMatch Permanent ^/(.*) http://www.domain2.com/$1  
</VirtualHost>

保存后重起apache服务器即可。

相关文章:

  • 2021-07-21
  • 2022-12-23
  • 2021-07-07
  • 2022-12-23
  • 2021-12-09
  • 2022-12-23
  • 2021-09-08
猜你喜欢
  • 2022-12-23
  • 2021-06-08
  • 2021-08-27
  • 2022-12-23
  • 2022-12-23
  • 2021-09-11
相关资源
相似解决方案