Personally, I fake mod_rewrite.
I write my URLs to look like mod_rewrite is in use, but I grab the whole URL, and parse the values manually. I find it works very nicely across multiple servers.
i.e.
index.php/autos/cars/chevy/cobalt
/* get page information from URL */
$PAGE = $_SERVER['REQUEST_URI'];
/* put URL and vars into slicable chunk -> index:/var1/var2/var3/etc */
$PAGE = preg_replace("#[/]?.*[/](.*)\.php(.*)#", "\\1:\\2", $PAGE);
/* explode into array -> [0] = page [1] = /var1/var2/var3/etc */
$pagevars = explode(":", $PAGE);
/* set $page to actual page (i.e. index.php) */
$PAGE = strtolower($pagevars[0]);
/* explode to get page vars (zero is empty) -> [1] = var1 [2] = var2 etc */
$pagevars = explode("\x2F", $pagevars[1]);
unset($pagevars[0]); unset($pagevars[1]);
/*set URL var pointer to /var1/var2/var3/etc */
$PAGEVARS = $pagevars;
echo $PAGEVARS[0].' '.$PAGEVARS[1].' etc...';
// the page vars would hold -> autos : cars : chevy : cobalt -> respectively
It may look sloppy (I have been using this since the beginning of time) but it works a treat.
🙂