所有点击量重定向到另一个域的根 [英] Redirect all traffic to root of another domain

查看:217
本文介绍了所有点击量重定向到另一个域的根的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个域名,这不是再被使用。我想重定向所有从 http://www.old.com/ http://www.new.com/ ,不管是什么网页用户试图访问的 www.old.com

I have a domain that's not to be used anymore. I want to redirect all from http://www.old.com/ to http://www.new.com/, no matter what page the user's attempted to access on www.old.com.

这样做:

RewriteEngine on
Redirect 301 / http://www.new.com/

是细根,但其他网页会做到这一点:

is fine for the root, but other pages would do this:

http://www.old.com/cms - > http://www.new.com/cms

而我希望它去根,不管是什么。

whereas I'd want it to go to the root, no matter what.

推荐答案

从<一个href="http://www.webconfs.com/how-to-redirect-a-webpage.php">http://www.webconfs.com/how-to-redirect-a-webpage.php我说你可以使用下面的配置。

From http://www.webconfs.com/how-to-redirect-a-webpage.php I'd say you can use the following configuration

不重定向子文件夹/文件(你想):www.example.com/demo/ - > www.newexampledomain.com

Don't redirect subfolders/files (as you wanted): www.example.com/demo/ -> www.newexampledomain.com

Options +FollowSymLinks
RewriteEngine on
RewriteRule (.*) http://www.newdomain.com/ [R=301,L]

重定向到子文件夹/文件:www.example.com/demo/ - > www.newexampledomain.com/demo /

Redirect to subfolders/files: www.example.com/demo/ -> www.newexampledomain.com/demo/

Options +FollowSymLinks
RewriteEngine on
RewriteRule (.*) http://www.newdomain.com/$1 [R=301,L]

这篇关于所有点击量重定向到另一个域的根的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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