.htaccess & mod_rewrite for passing GET parameters
- by Joel Alejandro
Currently I use this to pass GET parameters on an "elegant" way:
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^/]*)/$ index.php?module=$1 [L]
RewriteRule ^([^/]*)/([^/]*)/$ index.php?module=$1&object=$2 [L]
RewriteRule ^([^/]*)/([^/]*)/([^/]*)/$ index.php?module=$1&object=$2&submodule=$3 [L]
This works great for 3 parameters max., (and I'm sure it's seriously ugly).
Any way to do the same thing, for n-paremeters?