Reformat Paypal Callback to Custom URL Format Using htaccess
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
You need to match the query string part separately, something like this (not tested):
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]
精彩评论