我正在将网站上的旧网址重定向到其他网站上的新网址。它使用Zeus Web服务器,前两个规则工作得很好。然而它似乎没有玩第三个网址,其中有一个查询字符串...任何想法如何解决这个问题?好像我可能需要一个正则表达式来处理特殊字符?
,因为如果我把它从匹配中取出来它可以正常工作。感谢
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
答案 0 :(得分:0)
我不熟悉Zeus url重写。但如果它使用标准正则表达式,则需要使用反斜杠转义?
。
match URL into $ with ^/index.php\?cPath=1_50$
问号通常是元字符,它修改前面的字符或表达式,使其成为可选项。因此,您现在的模式将与/index.phpcPath=1_50
或/index.phcPath=1_50
匹配。