重写301使用新的域名更换域名 [英] rewrite 301 replace domain name with a new domain name

查看:204
本文介绍了重写301使用新的域名更换域名的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

男人 我需要mod-rewrite301一些帮助,我的旧网址重定向到新的地址, 这里是我的方案

guys I need some help on mod rewrite 301 , to redirect my old website address to the new address , here is my scenario

IVE www.domain1.com/page1/ 想重定向到domain2.com/page1 /

ive www.domain1.com/page1/ want to be redirect to domain2.com/page1/

香港专业教育学院,以取代所有的请求到达域1与域2和后.COM保持页面 所以watever是后.COM应该是相同只需更换域1与域2。 任何人都可以帮我这个 问候

ive to replace all request goes to domain1 with domain2 and keep the page after .com so watever was after .com should be the same just replace domain1 with domain2 . anyone can help me with this Regards

推荐答案

您可能希望确保UseCanonicalName关闭,以免阿帕奇更换主机名与该网站的服务器名称。

You may want to make sure UseCanonicalName is off, lest apache replace hostnames with the site's ServerName.

RewriteEngine on
RewriteCond %{HTTP_HOST} ^www\.domain1\.com$    [NC]
RewriteRule ^(.*)$       http://domain2.com$1   [R=301]

这篇关于重写301使用新的域名更换域名的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆