Pls help about my mod write....

Need help installing PHP, configuring a script, or configuring a server? Then come on in and post your questions! We'll try to help the best we can!

Moderator: General Moderators

Post Reply
meloncolie
Forum Newbie
Posts: 1
Joined: Fri Sep 30, 2005 6:35 am
Contact:

Pls help about my mod write....

Post by meloncolie »

heres my link http://localhost/shopping_cart/products ... 2&amount=1



heres my .htaccess...

RewriteEngine On
RewriteRule ^(.*)/(.*)/(.*)/(.*)/(.*).html /products.php?addtocart=$1&iid=$2&iname=$3&iprice=$4&amount=$5

pls help because it doesnt work...

:wink:
User avatar
Skara
Forum Regular
Posts: 703
Joined: Sat Mar 12, 2005 7:13 pm
Location: US

Post by Skara »

Your regex would validate "////.html".

RewriteRule ^(.+?)/(.+?)/(.+?)/(.+?)/(.+?).html /products.php?addtocart=$1&iid=$2&iname=$3&iprice=$4&amount=$5

Which will validate anything.html that is in a fourth level directory (there have to be four directories above it--no more, no less).

The + means one or more of the previous character. The ? means one or zero normally, but here it stems the .+ so that it only catches one instance of it.

I'm not too familiar with mod_rewrite, but I believe you may need the address there.

RewriteRule ^(.+?)/(.+?)/(.+?)/(.+?)/(.+?).html http://youraddy.ext/products.php?addtoc ... &amount=$5
Post Reply