I need to go from
/folder/12345/?foo=abc
to /folder/index.php?id=12345&foo=abc
head butting the wall it should be easy but I can't get it to work anybody know the answer of the top of there head
Paul
I need to go from
/folder/12345/?foo=abc
to /folder/index.php?id=12345&foo=abc
head butting the wall it should be easy but I can't get it to work anybody know the answer of the top of there head
Paul
well i assume you are already inside "folder" then can just write this code inside your .htaccess file or server config INSIDE THAT FOLDER
RewriteEngine On
RewriteRule ([0-9]+) index.php?id=$1 [QSA,L]
it will match anything with digits and then append it as id parameter, the QSA flag appends every already set url parameters, so you dont loose any (as your foo). the L flag is important so that no infinite redirect loops occour!
if the folder "folder" doesnt actually exist but you are working one directory level higher (with you .htaccess file) you can do the following:
RewriteEngine On
RewriteRule folder/([0-9]+) index.php?id=$1 [QSA,L]