Is it possible to use the .htaccess rebrand and an undefined number of parameters in the URL?
In my current .htaccess I set three types of parameters that can be passed in the URL (/ page / sub / id), however I would like to be able to pass an unlimited number of parameters and that they follow an array-like order (/ 1/2/3/4 / ...), is it possible?
My current .htaccess:
Options -Indexes
RewriteEngine On
RewriteCond %{SCRIPT_FILENAME} !-f
RewriteCond %{SCRIPT_FILENAME} !-d
RewriteRule ^([^/]*)$ index.php?page=$1 [L]
RewriteCond %{SCRIPT_FILENAME} !-f
RewriteCond %{SCRIPT_FILENAME} !-d
RewriteRule ^([^/]*)/([^/]*)$ index.php?page=$1&sub=$2 [L]
RewriteCond %{SCRIPT_FILENAME} !-f
RewriteCond %{SCRIPT_FILENAME} !-d
RewriteRule ^([^/]*)/([^/]*)/([^/]*)$ index.php?page=$1&sub=$2&id=$3 [L]
Doubt: Is it possible to do this without having to do some "alternative way" using explode()
for example?