I\'m a total n00b at mod_rewrite and what I\'m trying to do sounds simple:
instead of having domain.com/script.php?a=1&b=2&c=3 I would like to have:
I would use PHP to parse the requested URL path:
$_SERVER['REQUEST_URI_PATH'] = parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH);
$params = array();
foreach (explode(',', substr($_SERVER['REQUEST_URI_PATH'], 6)) as $param) {
if (preg_match('/^([^:]+):?(.*)$/', $param, $match)) {
$param[rawurldecode($match[1])] = rawurldecode($match[2]);
}
}
var_dump($params);
And the mod_rewrite rule to rewrite such requests to your /script.php
file:
RewriteRule ^script\|.+ script.php [L]