Forum Moderators: phranque
I have a problem with mod_rewrite. I need to rewrite this:
/support/documentation/?var=value
To this:
/support.php?page=documentation&var=value
I'm obviously approaching this the wrong way, but a couple of things I've tried are:
RewriteCond %{REQUEST_URI} ^support/documentation/(.+)$
RewriteCond %{QUERY_STRING} ^(.*)$
RewriteRule ^(.*)$ /support/documentation/$1?%1 [L] fhshsfj
And
RewriteRule ^support/documentation/\?(.+)$ /support.php?page=documentation&$1
Can anyone point me in the right direction?
Thanks in advance
Simple method:
RewriteCond %{QUERY_STRING} !page=
RewriteRule ^support/documentation/$ /support.php?page=documentation [QSA,L]
RewriteCond %{QUERY_STRING} !page=
RewriteCond %{QUERY_STRING} (var=[^&]+)
RewriteRule ^support/documentation/$ /support.php?page=documentation&%1 [L]
In both cases above, the first RewriteCond prevents an 'infinite' rewriting loop in .htaccess.
Jim