我有两个域运行与所有相同的页面,其中一个是停靠,但在两个域的所有页面都是完全相同的。
我需要解决的问题是,谷歌索引的所有页面都来自停靠的域名,需要重定向到新的域名页面
例如www.parked.com/notparked.html到www.live.com/notparked.html
有什么关于如何正确处理这件事的帮助吗?这有可能吗?
发布于 2018-06-04 14:15:01
你是说同一条路吗?
两者在JavaScript中都有相同的location.pathname,
因此,您可以轻松地使用http://your.new.host concat window.location.pathname获取新的url。
例如:
$('a').click(function(event){
event.preventDefault();
window.location.href = "http://your.new.host" + window.location.pathname;
})https://stackoverflow.com/questions/50674301
复制相似问题