0

I'm using URL rewriting through .htaccess on my site. Then I submit through PayPal's ExpressPay and get something like the following returned:

http://mydomian.com/cart/success?token=EC-123456789&PayerID=123456789

The /cart and /success are great, but is there an easy way to grab the "token" an "PayerID" variables?

Here's the .htaccess I'm working with:

RewriteRule ^([^/\.]+)/?$ index.php?load=$1
RewriteRule ^([^/\.]+)/([^/\.]+)/?$ index.php?load=$1&query=$2
RewriteRule ^([^/\.]+)/([^/\.]+)/([^/\.]+)/?$ index.php?load=$1&query=$2&query2=$3 [L]
0

3 Answers 3

2

Add a [QSA] to each of your rules, and change your third rule to have these flags: [L,QSA]. This will make it so the query string you get back from PayPal will be appended and you'll be able to access them from index.php.

Sign up to request clarification or add additional context in comments.

1 Comment

Perfect! Exactly what I was looking for.
0

you can use {QUERY_STRING} as the condition http://www.simonecarletti.com/blog/2009/01/apache-rewriterule-and-query-string/

Comments

0

See: URL Rewrite - Query String

Or just have mydomain.com/cart/success grab $_GET['token']

1 Comment

Your rewrite is eliminating it then? Might be easier if you share your htaccess info in your question.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.