windows系统虚拟主机设置301重定向的方法

SEO技巧3,226

手动设置的(没有自动生成)

1、进入主机控制面板,进入ISAPI筛选器设置,点击"开启自定义URL静态化支持"按钮。文章源自SEO视频网-https://www.seoshipin.cn/seojiqiao/99.html

2、待开启伪静态功能后,进入FTP文件管理,找到\others\discuz\httpd.conf 修改这里面的规则。文章源自SEO视频网-https://www.seoshipin.cn/seojiqiao/99.html

3、示例代码:文章源自SEO视频网-https://www.seoshipin.cn/seojiqiao/99.html

  1. RewriteCond %{HTTP:Host} ^abc.com$
  2. RewriteRule (.*) http://www.abc.com$1 [NC,R=301]

注:第一条表示要做跳转的域名,第二条表示要跳转到的域名文章源自SEO视频网-https://www.seoshipin.cn/seojiqiao/99.html

 文章源自SEO视频网-https://www.seoshipin.cn/seojiqiao/99.html

如果有很多域名要做跳转,那么可以将第一条规则改为:文章源自SEO视频网-https://www.seoshipin.cn/seojiqiao/99.html

  1. RewriteCond %{HTTP:Host} !^www.abc.com$

 文章源自SEO视频网-https://www.seoshipin.cn/seojiqiao/99.html

这样,就表示非www.abc.com的域名访问都会跳转到www.abc.com #多个域名做跳转的第二种方法是,首先复制多个 RewriteCond 项,将域名改好 除了最后一项,其余的 RewriteCond 项最后都要加个参数 [OR]即可。文章源自SEO视频网-https://www.seoshipin.cn/seojiqiao/99.html

注意:现在很多虚拟主机都自带301的配置,可以在主机控制面板上生成代码信息,然后按照上面的提示进行301重定向。文章源自SEO视频网-https://www.seoshipin.cn/seojiqiao/99.html 文章源自SEO视频网-https://www.seoshipin.cn/seojiqiao/99.html

 
  • 本文由 潮涌SEO 发表于 2017年4月8日 02:33:23
  • 转载请务必保留本文链接:https://www.seoshipin.cn/seojiqiao/99.html