0
Replacing key in ${QUERY_STRING} via .htaccess
Hello together! Could someone please give me a tip how to replace the key in a query string but keep the value (in this case the value is allways a hash)? Basically it want to do that: index.php?OLDKEY=(hash) -> index.php?NEWKEY=(hash) Right now i have something like that in my .htaccess: RewriteCond ${QUERY_STRING} ^OLDKEY=(.*)$ RewriteRule index\.php /index.php?NEWKEY=$1 ... but this does not work :/ Could someone give me a hint how i could do this? Thanks alot!
1 ответ
0
... i found it out by myself. My rule looks like that:
RewriteCond %{QUERY_STRING} ^OLDKEY=([^&]*) [NC]
RewriteRule ^index\.php$ %{REQUEST_URI}?NEWKEY=%1 [L,NC,R=301]