I need both the urls below http://www.mydomain.com/index.php?k=keyword&s=seller http://www.mydomain.com/?k=keyword&s=seller to become like one of the three below, the one that will work best for both engines and humans ... Any sugestions ??? http://www.mydomain.com/keyword/seller.html http://www.mydomain.com/keyword/seller/ http://www.mydomain.com/keyword/seller Lest say we can get it too look like this: http://www.mydomain.com/keyword/seller.html Later, whenit works, HOW can I get bacl the value for the variables in my PHP script? I.e ... How do I get $k to be "keywords" and $s to be "seller" so I can use the posted values in my php prg's ???
Options FollowSymLinks RewriteEngine on RewriteRule ^([^/]+)/([^/]+)/$ index.php?k=$1&s=$2 [L,NC] RewriteRule ^([^/]+)/([^/]+)\.html$ index.php?k=$1&s=$2 [L,NC] You can use $_GET or $_REQUEST to get back the values of the variables. Something like $k = $_REQUEST['k']; and $s = $_REQUEST['s'];