使用 htaccess 将 Paypal 回调重新格式化为自定义 URL 格式
根据我的设置,Paypal 返回以下示例响应:
http://www.mydomain.com/some-seo-text-buy-callback.html?token=EC-80997676W8765&PayerID=KHDGEYEDJKD
我希望所有开发人员都遵循客户端指定的处理控制器和模块的结构,并且 Paypal 响应无法正确分段。所以我将这一行插入到 htaccess 文件中:
RewriteRule ^some-seo-text-(.*)-(.*)\.html?token=(.*)-(.*)&PayerID=(.*) /index.php?c=$1&m=$2&token=$3-$4&payerid=$5 [L]
尽管如此,它还是失败了。我猜这不符合规则。正如你所看到的,我对正则表达式很不擅长,而且我没有时间研究它,因为我们的日程安排真的很紧。
有人可以告诉我哪里做错了,并指出我正确的方向吗?
谢谢说! :D
Based on my settings, Paypal returns the following sample response:
http://www.mydomain.com/some-seo-text-buy-callback.html?token=EC-80997676W8765&PayerID=KHDGEYEDJKD
I want all developers to follow the client-specified structure of the handling controllers and modules and the Paypal responses just fails to be segmented properly. So I inserted this line to the htaccess file:
RewriteRule ^some-seo-text-(.*)-(.*)\.html?token=(.*)-(.*)&PayerID=(.*) /index.php?c=$1&m=$2&token=$3-$4&payerid=$5 [L]
Still, it fails. I'm guessing it's not falling into the rule. As you can see I'm bad with regex and I have no time to study it coz we're really on a tight schedule.
Can somebody tell me where am I doing it wrong and kindly point me out to the right direction?
Thankee sais! :D
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您需要单独匹配查询字符串部分,如下所示(未测试):
You need to match the query string part separately, something like this (not tested):