I am cleaning up a large .htaccess
file containing a lot of mod_rewrite
statements.
The biggest part of the clutter comes from statements catching various occurrences of
/directory1
/directory1/directory2
/directory1/directory2/directory3
using statements like
RewriteCond %{REQUEST_URI} ^/([^/]+)/([^/]+)$
RewriteRule .* /front.php?level1=%1&level2=%2&%{QUERY_STRING} [L]
RewriteCond %{REQUEST_URI} ^/([^/]+)/([^/]+)/([^/]+)$
RewriteRule .* /front.php?level1=%1&level2=%2&level3=%3&%{QUERY_STRING} [L]
could somebody versed with mod_rewrite give me a pointer on how to write one universal statement that will catch any depth of directory1/directory2...
and put the appropriate level
variable into the RewriteRule?