mod_rewrite and sf url's

janthuis

New member
Joined
Jan 2, 2009
Messages
2
Although I'm new on mod_rewrite I try to use it to produce search engine friendly url"s. My method on an url with only one $ var seems to work, but if there are more $ var's in the url it seems not to work.
For instance, this works fine:
PHP:
rewriteEngine on
Options +FollowSymlinks
rewriteBase / 
rewriteRule (.*)\.htm$ /index.php?naam=$1 
rewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /index\.php\?naam=([^&]+)\ HTTP/ 
rewriteRule ^index\.php$ http://www.citroen-2cv-parts.com/%1.htm? [R=301,L]
The url http://www.citroen-2cv-parts.com/index.php?naam=contact is correct rewritten to http://www...../contact.htm
But if there are more vars like in http://www.citroen-2cv-parts.com/index.php?list=list&menu=1
nothing seems to work. I did some Google search an came up with the most common method as
PHP:
RewriteRule ^testcase/(.*)/page(.*)\.php /index.php?list=$1&menu=$2 [L]
but it seems not to work, nothing changes in the shown url.
For now I try to find the clu like this:
PHP:
{THE_REQUEST} ^[A-Z]{3,9}\ /index\.php\?list=([^&]+)&menu=([^&]+)\ HTTP/ 
 RewriteRule ^testcase/(.*)/(.*) index.php?list=$1&menu=$2
My final goal is to find the right method for rewriting url's with 4 var's like
HTML:
http://www.citroen-2cv-parts.com/index.php?list=list&menu=1&part=34&prod=starter
Is there someone to help me out? What can I do to make this work on my DirectAdmin server?
I'm not sure if it makes any different but the url's are created in PHP like this:
HTML:
<a href=\"".$_SERVER["PHP_SELF"]."?list=list......
 
Back
Top