The issue is roughly - I want a request path such as this:


to become overwritten like:


Any ideas ?

mod_rewrite is not likely to have the ability to parse key/value pairs by itself. Your best choice would be to have index.php help using the parsing.

Your .htaccess file would seem like this:

# Allow any files or directories that exist to be displayed directly
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

# Rewrite all other URLs to index.php/URL
RewriteRule .* index.php/$0 [PT,L]

You would then use PHP at the outset of index.php to setup the $_GET variable:

$params = explode('/', trim($_SERVER['REQUEST_URI'], '/'));

for ($i=0; $i<count($params); $i+=2) {
    $_GET[$params[$i]] = $params[$i+1];

Try these rules:

RewriteRule ^([^/]+)/([^/]+)/(.+) /$3?$1=$2 [QSA,N]
RewriteRule ^([^/]+)/([^/]+)$ index.php?$1=$2 [QSA,L]

But you’re best using the PHP solution.