benjam1nrk
05-25-2009, 06:48 PM
Hello,
I am using a htaccess mod rewrite rule which redirects http://mysite.com/payment/PaymentID to http://mysite.com/payment.php?ID=PaymentID. This redirect works perfectly.
I would also like to rewrite the rule so http://mysite.com/payment/PaymentID appears in the browser URL. I have done this with pages with no query string. For example accessing http://mysite.com/pricing redirects to http://mysite.com/pricing.php but http://mysite.com/pricing still appears in the browser URL. Below is an example of my htaccess:
#Shorten URLs entered in original link form
RewriteCond %{ENV:REDIRECT_STATUS} ^.
RewriteRule ^ - [L]
RewriteRule ^pricing.php$ /pricing [R=301,L]
#Point short URL's to correct file
RewriteRule ^pricing$ pricing.php [NC,L]
How would I go about rewriting the URL if it contains a query string? I have something like this so far, but does not work: #RewriteCond %{ENV:REDIRECT_STATUS} ^.
#RewriteCond %{QUERY_STRING} ^PaymentID=(.*)$
#RewriteRule ^payment.php$ /payment/%1? [R,L]
Thank you for any assistance!
I am using a htaccess mod rewrite rule which redirects http://mysite.com/payment/PaymentID to http://mysite.com/payment.php?ID=PaymentID. This redirect works perfectly.
I would also like to rewrite the rule so http://mysite.com/payment/PaymentID appears in the browser URL. I have done this with pages with no query string. For example accessing http://mysite.com/pricing redirects to http://mysite.com/pricing.php but http://mysite.com/pricing still appears in the browser URL. Below is an example of my htaccess:
#Shorten URLs entered in original link form
RewriteCond %{ENV:REDIRECT_STATUS} ^.
RewriteRule ^ - [L]
RewriteRule ^pricing.php$ /pricing [R=301,L]
#Point short URL's to correct file
RewriteRule ^pricing$ pricing.php [NC,L]
How would I go about rewriting the URL if it contains a query string? I have something like this so far, but does not work: #RewriteCond %{ENV:REDIRECT_STATUS} ^.
#RewriteCond %{QUERY_STRING} ^PaymentID=(.*)$
#RewriteRule ^payment.php$ /payment/%1? [R,L]
Thank you for any assistance!