Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/.htaccess/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
.htaccess htaccess将部分匹配url重定向到另一个主机_.htaccess - Fatal编程技术网

.htaccess htaccess将部分匹配url重定向到另一个主机

.htaccess htaccess将部分匹配url重定向到另一个主机,.htaccess,.htaccess,我已经尝试了我找到的每个建议,但仍然无法获得一个部分匹配的url重定向到另一个站点。我有一些流氓,他们在我的域名末尾添加“/hyperion expert in san angelo/”等字符串,以获取服务器错误日志反向链接,我无法阻止,这占用了大量带宽 我可以重定向每个实例 Redirect 301 /hyperion-consultant-in-new-haven/ {new url} Redirect 301 /lawson-developer-in-new-bedford/ {new u

我已经尝试了我找到的每个建议,但仍然无法获得一个部分匹配的url重定向到另一个站点。我有一些流氓,他们在我的域名末尾添加“/hyperion expert in san angelo/”等字符串,以获取服务器错误日志反向链接,我无法阻止,这占用了大量带宽

我可以重定向每个实例

Redirect 301 /hyperion-consultant-in-new-haven/ {new url}
Redirect 301 /lawson-developer-in-new-bedford/ {new url}
Redirect 301 /lawson-developer-in-new-orleans/ {new url}
Redirect 301 /oracle-developer-in-el-monte/ {new url}
Redirect 301 /hyperion-developer-in-san-angelo/ {new url}
Redirect 301 /lawson-expert-in-thousand-oaks/ {new url}
Redirect 301 /lawson-expert-in-flower-mound/ {new url}
Redirect 301 /hyperion-expert-in-san-diego/ {new url}
Redirect 301 /hyperion-developer-in-san-diego/ {new url}
Redirect 301 /oracle-expert-in-ellicott-city/ {new url}
但是他们一直在来。我想重定向任何与hyperion,劳森等网址到另一个网站。这不起作用:

RewriteRule ^hyperion(/|$) {new url} [R=301,L,QSA,NC]

使用以下规则:

RewriteEngine On
RewriteRule ^/?(hyperion|lawson|oracle).*$ {new url} [R=301,L,NC]
考虑到这些请求只是流氓,您不需要
QSA
标志