Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/regex/17.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
Regex 引用重定向的正则表达式_Regex_.htaccess_Redirect - Fatal编程技术网

Regex 引用重定向的正则表达式

Regex 引用重定向的正则表达式,regex,.htaccess,redirect,Regex,.htaccess,Redirect,我需要正则表达式重定向如下链接: www.mysite.com/forums/users/tom www.mysite.com/forums/users/tom/favorites/ 收件人:http://www.mysite.com/dashboard/listings/tom 问题是我使用的脚本构造了如下链接: www.mysite.com/forums/users/tom www.mysite.com/forums/users/tom/favorites/ 我只需要重定向www.m

我需要正则表达式重定向如下链接:

www.mysite.com/forums/users/tom
www.mysite.com/forums/users/tom/favorites/
收件人:
http://www.mysite.com/dashboard/listings/tom

问题是我使用的脚本构造了如下链接:

www.mysite.com/forums/users/tom
www.mysite.com/forums/users/tom/favorites/
我只需要重定向
www.mysite.com/forums/users/tom
,而不重定向
www.mysite.com/forums/users/tom/favorites/
,我想保持原样

有没有办法做到这一点


请帮帮我(

这应该有效,并且只重定向
mysite.com/referer/
,而不是
mysite.com/referer/topic

RewriteEngine on
RewriteRule ^referrer/$ http://someurl.com [L,R=301]
编辑:


谢谢你,我的朋友,但这是个问题。推荐人不是静态的。:(但每个推荐人都会被重定向到同一个someurl?不知道我把事情搞砸了。如果你能帮我,我甚至可以付钱给你。只要给我你的paypal电子邮件,我会给你10美元:(你所说的与上面你想要更改的url不同。你能用你想要重定向的链接编辑你的问题吗?非常抱歉给你带来麻烦。如果你能找到解决方案,我会在你的paypal地址中给你支付10美元。我已经编辑了这篇文章。