I'm writing some of my own rules for a few PHP scripts I'm writing, even though I have little experience with regexp. Note: little.
Basically I want to pass all URLs except a few as arguments to index.php, rewriting most URLs defined as slugs in a database.
ie: /admin, /config, /images, /lib and /template exists, but I do not want to be rewritten. But everything else, I want passed as arguments to index.php.
I'm doing this currently with:
url.rewrite-once = (
"^/(.*)$" => "/index.php?$1"
)
Which works beautifully with the database slugs, however it also redirects the folders listed above. These contain files needed to be directly accessed, but I can't find anywhere describing how to exclude strings from a match.
Once I know how to do this, I can figure out the rest, but being new to regexp I don't know where to start.
Any help would be greatly appreciated.
Edit: I've since given these a shot:
"^/(index\.php|admin|config|images|lib|template)" => "$0",
For which FF reports an endless redirect for those folders;
"^/(?!(admin|config|images|lib|template))(.*)$" => "$0"
Doesn't match everything but the folders;
"^/([^(admin|config|images|lib|template)]*)$" => "/index.php?$1"
Again, doesn't rewrite anything;
"^/(.*)$" => "/index.php?$1"
Rewrites everything, including the folders which I don't want rewritten.