This might be easy but i am a newbie :)

New to mod_rewrite? This is a good place to start.

This might be easy but i am a newbie :)

Postby basdog22 » Thu Mar 02, 2006 9:24 am

Hello. I found this forum today as i was searching for mod_rewrite tutorials. I am from Greece and i am new to this thing.

I have been testing some things and i can't understand why this piece of rules don't work:

Code: Select all
RewriteRule ^(.*).htm $1.php
RewriteRule ^(.*)-(.*)-(.*).htm $1.php?$2=$3
RewriteRule ^(.*)-(.*)-(.*)-(.*)-(.*).htm $1.php?$2=$3&$4=$5


When i save the htaccess like the above, the only rule that works is the first. All the others give me errors.

So if i comment out the first line then the only one that works is the second one:

Code: Select all
#RewriteRule ^(.*).htm $1.php
RewriteRule ^(.*)-(.*)-(.*).htm $1.php?$2=$3
RewriteRule ^(.*)-(.*)-(.*)-(.*)-(.*).htm $1.php?$2=$3&$4=$5


and so on. Only the first uncommented rule works.

Why is this happening and how can i work this out?

I hope i am not doing something stupid :o
basdog22
 
Posts: 1
Joined: Thu Mar 02, 2006 9:13 am

Return to Beginner's Corner

Who is online

Users browsing this forum: Google [Bot] and 38 guests

cron