问题描述
男人我需要国防部重写301一些帮助,我的旧网址重定向到新的地址,这里是我的方案
guysI 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 .comso watever was after .com should be the same just replace domain1 with domain2 .anyone can help me with thisRegards
推荐答案
您可能希望确保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使用新的域名更换域名的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!