I've searched the web and stack-overflow for this, and got a few answers. Oddly enough, they just don't work and I can't figure out why!
I have an index.php file that receives the URL folders and parameters. For example: example.com/folder1/folder2/?param=a¶m2=b I am echoing them inside the index.php like this:
<?php
echo "<pre>";
echo "Folders: "; print_r($_GET['folders']);
echo "<br>";
echo "Parameters: "; print_r($_GET['parameters']);
echo "</pre>";
?>
And this is the output that I get:
Folders: folder1/folder2/
Parameters: folder1/folder2/
This is the htaccess that I use:
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?folders=$0¶meters=$1 [QSA,L]
How do I achieve an output like this:
Folders: folder1/folder2/
Parameters: a/b/
(or inside an array. Anything that would let me work with later)