gpt4 book ai didi

regex - 使用 htaccess 将 Paypal 回调重新格式化为自定义 URL 格式

转载 作者:太空宇宙 更新时间:2023-11-03 16:38:15 24 4
gpt4 key购买 nike

根据我的设置,Paypal 返回以下示例响应:

http://www.mydomain.com/some-seo-text-buy-callback.html?token=EC-80997676W8765&PayerID=KHDGEYEDJKD

我希望所有开发人员都遵循客户指定的处理 Controller 和模块结构,而 Paypal 响应未能正确分段。所以我将这一行插入到 htaccess 文件中:

RewriteRule ^some-seo-text-(.*)-(.*)\.html?token=(.*)-(.*)&PayerID=(.*)  /index.php?c=$1&m=$2&token=$3-$4&payerid=$5 [L]

还是失败了。我猜这不符合规则。如您所见,我不擅长正则表达式,而且我没有时间研究它,因为我们的时间真的很紧。

谁能告诉我哪里做错了,并请指出正确的方向?

谢谢你! :D

最佳答案

你需要单独匹配查询字符串部分,像这样(未测试):

RewriteCond %{QUERY_STRING} token=(\w+-\w+)&PayerID=(\w+)
RewriteRule ^some-seo-text-(\w+)-(\w+)\.html /index.php?c=$1&m=$2&token=%1&payerid=%2 [L]

关于regex - 使用 htaccess 将 Paypal 回调重新格式化为自定义 URL 格式,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5308652/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com