2
It is possible to use rescrita with . htaccess and an undefined number of parameters in the URL?
In mine. current htaccess I have defined three types of parameters that can be passed in the URL (/page/sub/id), but I would like to be able to pass an unlimited number of parameters and that they follow an order as in an array (/1/2/3/4/...), it is possible to?
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: it is possible to do this without having to do some "alternative way" using explode()
for example?
I didn’t understand.
– Rafael Alexandre
Redirect any address to a type page
seletor.php?parametros
and split the bars in PHP and not in htaccess.– Bacco