You could set an environment variable:
RewriteRule ^(bla|blo|bli|blu|bloi|bkdo|doid|boidi|woekj|dfpo8ds)/?$ /section_index.php?sectionurl=$1 [L,E=FOOBAR:$1]
The value is now accessible with %{ENV:FOOBAR}
.
Edit Another way would be to process the request in steps and chain the rules:
# first path segment
RewriteRule ^(bla|blo|bli|blu|bloi|bkdo|doid|boidi|woekj|dfpo8ds)/?([^/].*)?$ $2?sectionurl=$1 [QSA,C]
# second path segment
RewriteRule ^(blog|foo)/?([^/].*)?$ $2?arg1=$1 [QSA,C]
# third path segment
RewriteRule ^(bar|baz)/?([^/].*)?$ $2?arg2=$1 [QSA,C]
# last rule
RewriteRule ^$ section_index.php [L,QSA]
But as you use PHP, you could also use PHP to parse the request path, for example:
$_SERVER['REQUEST_URI_PATH'] = preg_replace('/\?.*/', '', $_SERVER['REQUEST_URI']);
$segments = explode('/', trim($_SERVER['REQUEST_URI_PATH'], '/'));
$argNames = array('sectionurl', 'arg1', 'arg2', 'arg3');
foreach ($segments as $i => $segment) {
if (isset($argNames[$i])) {
$_GET[$argNames[$i]] = $segment;
}
}
var_dump($_GET);
Now you just need to send every request to that PHP file by using this rule:
# exclude requests for existing files
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]