Well, the example you provided before wasn't representative of what you needed so that's why it didn't work. Things like character case, the types of letter allowed and such are very important when constructing regex. Here's an updated line that should accommodate the sample you provided.

The rewrites we have been working on are applied when someone either types in the URL or clicks on a link for a certain URL, then it is rewritten to the new format. I don't know that this case necessarily falls under this. Can you explain more about the PayPal part? Is PayPal accessing a URL that needs to be rewritten? Does a file exists where the rewritten URL points to?

Now my problem with this is that i cant get php to read the bit after the ? because ? is already set at ?rt=$1 which is for all the internal framework stuff.
So i don't know how to get the values token and payerid out of the url unless i manually do it in the url bar but i could not expect a user to want to do with.

Can you share what you're trying to use to get the stuff after the ? that you're having issues with? It's not clear why you can't access that info. I've never messed with the PayPal checkout stuff so I'm still having trouble following the code logic you're using, but I think the Apache rewrite likely won't get you there based on what I think I understand on your situation.

Ok well i have slept on it for a couple days trying to work it out but i can't get my head round it.
In a nut shell it is a 3 step process.

This is the first script this sends out the request to paypal with the return address. The real address with htaccess off would be index.php?rt=products/returnexpress

PHP:

public function paypalexpress() {// SetExpressCheckout // On Success Will return a token with value like EC-7EG51014BE327234S // Customer should then be redirected by your server to URL like // https://www.sandbox.paypal.com/cgi-bin/webscr?cmd=_express-checkout&token=EC-7EG51014BE327234S // Customer will then enter payment at paypal.com and upon success customer will be sent back to the $ReturnURL // that you provided in the operation with the tokon and PayerID appended as parameters to the $ReturnURL //==========================================================================================================$API = $this->Cabbit->Paypal;

The rt is the un url rewritten path to the receiving page. Paypal returns a token to the page i specify but the token it returns is ?token when my pages are all rewritten index.php?rt=class/function to /class/function to make it nice and neat.

Is there a way i could put in some conditional logic to a htaccess to rewrite index.php?token=****&payerid=****
to
index.php?rt=****/****&token=****&payerid=*****

I think that would cut out a lot of the complexity.

Paypal it self attaches the ?token to the url i give it, what would be ideal is if i could ether change the ?token or set it to return to index to php and have the url rewritten to /class/function/token/payerid/ from there rather than doing it at the /class/function/ stage.

^_^ oh thats what the L means, emm can you recommend a book i would love to know how to do this bit without needing to ask for help it seems there is more to programming than php/rails/html/css and javascript when making sites.

MacRumors attracts a broad audience
of both consumers and professionals interested in
the latest technologies and products. We also boast an active community focused on
purchasing decisions and technical aspects of the iPhone, iPod, iPad, and Mac platforms.