Reputation: 37
I'm trying to rewrite the following URL:
http://mysite.com/app/checkout/success?token=2V5W&PayerID=WBBQER
to
http://mysite.com/app/index.php?url=checkout/process/2V5W/WBBQER
This rewrite is only needed for GET request of the format (/checkout/success?token=xx&payerID=xx), where both "token" and "payerID" are fixed parameters.
I'm also including my current .htaccess:
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-l
RewriteRule ^(.+)$ index.php?url=$1
I've been trying countless .htaccess possibilities to no avail so your help will be greatly appreciated.
Upvotes: 0
Views: 1020
Reputation: 13511
Try this
RewriteCond %{QUERY_STRING} ^token=([^\&]+)&PayerID=(.*)$ [NC]
RewriteRule ^app/checkout/success$ http://mysite.com/app/index.php?url=checkout/process/$1/$2 [R=301,NE,NC,L]
Upvotes: 4