hi i read the other thread about mod_rewrite(), on this forum, but i'm still trying to modify it for me, and no result. so when i have: ../phones.php i want to be transformed in ../phones ../phones.php?mn=motorola -> ../phones/motorola ../phones.php?mn=motorola&pn=v3 -> ../phones/motorola/v3 haw do i make this? which is the .htaccess for this example? thanks
Options +Indexes Options +FollowSymlinks RewriteEngine on RewriteBase / RewriteRule ^phones/(.*)/(.*)$ phones.php?mn=$1&pn=$2 [L] RewriteRule ^phones/(.*)$ phones.php?mn=$1 [L] RewriteRule ^phones$ phones.php [L]
It started on Amazons associate board when I first tried to make a mod_rewrite version of MrRats COOL AWS script. I made a post asking how to change a few URLs, just like this thread. I made a few changes to the code and then it worked!! Now every one over at the Amazon Associate boards hate me, and I hate myself, because I generated a TON of competition for Amazon stores, I got over 150 paid users, generating competition (Yes, they got unlimated updates. ). Luckly I got over 1,000,000 AWS URLs indexed in Google right now! Before the hack was used by a lot of users, I had a $7,500 Q4 quarter. Now I'm lucky if Q4 is $1,000. Moral of the story, if you find an easy way to get rich quick, SHUT UP ABOUT IT!!!!!
RewriteRule cannot have query strings in the pattern. You need to use something like this (assuming that you want to redirect): RewriteCond %{QUERY_STRING} ^mn=([^&]+)&pn=([^&]+)$ RewriteRule ^\.\./phones\.php$ ../phones/%1/%2? [R=301,L] J.D.