0

我将网站上的旧网址重定向到不同网站上的新网址。它使用 Zeus 网络服务器,前两条规则运行良好。然而,它似乎并没有与第三个网址打球,其中有一个查询字符串......关于如何解决这个问题的任何想法?好像我可能需要一个正则表达式来处理特殊字符?,因为如果我把它从比赛中去掉,它就可以正常工作。谢谢

match URL into $ with ^/$
if matched
set OUT:Location = http://www.website.co.uk/
set OUT:Content-Type = text/html
set RESPONSE = 301
set BODY = Moved
goto END
endif

match URL into $ with ^/index.php$
if matched
set OUT:Location = http://www.website.co.uk/
set OUT:Content-Type = text/html
set RESPONSE = 301
set BODY = Moved
goto END
endif

match URL into $ with ^/index.php?cPath=1_50$
if matched
set OUT:Location = http://www.website.co.uk/categories.php?category=Boilers
set OUT:Content-Type = text/html
set RESPONSE = 301
set BODY = Moved
goto END
endif
4

1 回答 1

0

我不熟悉 Zeus url 重写。但如果它使用标准正则表达式,则需要?用反斜杠转义。

match URL into $ with ^/index.php\?cPath=1_50$

问号通常是一个元字符,它修改前面的字符或表达式,使其成为可选的。所以你现在的模式将匹配/index.phpcPath=1_50or /index.phcPath=1_50

于 2012-07-12T19:55:28.690 回答