如何将来自某些域的流量重定向到新的网址 [英] How to redirect traffic that comes from certain domains, to a new url

查看:94
本文介绍了如何将来自某些域的流量重定向到新的网址的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要重定向来自一堆域的所有访问者的流量,但是他们都具有相同的页面.

I need to redirect traffic for all the visitors coming from a bunch of domains, but they all have the same page.

所以所有引荐来源都像这样:

So all referrers like this:

hxxp://domain1.com/search.php
hxxp://domain2.com/search.php
hxxp://domain3.com/search.php

因此,当这些访问者进入我的页面时,他们将通过另一个URL进行重定向,但是所有其他推荐访问者都将访问该网站.

So when these visitors come to my page, they will be redirected through another url, however all other referring visitors will go to the site.

想法?

推荐答案

在.htaccess文件中,假定YourNewDestination.com是所需的目标:

In your .htaccess file, assuming YourNewDestination.com is the desired destination:

RewriteEngine on
RewriteCond %{HTTP_REFERER} /search\.php$ [NC]
RewriteRule ^(.*)$ http://YourNewDestination.com

这篇关于如何将来自某些域的流量重定向到新的网址的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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