我想要从www.xyz.com/test/123
到http://www.zxy.de/?learningCardsDeeplinkUrl=http%3A%2F%2Ftest1.test2.com%2Findex.html%23%21%2FflashCard%2F123123
并在htaccess中尝试此条目:
RewriteRule ^test/(.*)$ http://www.zxy.de/?learningCardsDeeplinkUrl=http%3A%2F%2Ftest1.test2.com%2Findex.html%23%21%2FflashCard%2F$1
结果是:
targetUrl=httpAFFtest1.test2.comFindex.html31FflashCardF123
目标网址中缺少%。
有什么想法吗?
答案 0 :(得分:1)
您需要在目标网址中转义%
,因为%3
,%2
等表示来自RewriteCond
的反向引用变量:
RewriteRule ^test/(.*)$ http://www.zxy.de/?learningCardsDeeplinkUrl=http\%3A\%2F\%2Ftest1.test2.com\%2Findex.html\%23\%21\%2FflashCard\%2F$1 [L,R,NE]