Need to use *flags*? *RewriteCond*? The *mod\_rewrite* is enabled and wroking, my problem is how to express my needs: there are a generic rule and some exceptions to the rule, the exceptions not working, and solution must avoid loops.

My `/var/www` before to use *mod\_rewrite*, was working with usual folders like `/var/www/wiki`, `/var/www/foo`, `/var/www/bar` (each with its index). I need to preserve this behaviour.

Now, with *mod\_rewrite*, I am using a `/var/www/index.php` to redirect some special strings, that match `^([a-z0-9]+)`, such as `http://myDomain/foo123` or `http://myDomain/wiikii`. But it matches also "wiki" and "foo", that **need exception handling**. 

---

My `/var/www/.htaccess` is

```
 RewriteEngine on
 RewriteRule   ^/?(foo|bar)([0-9]+)      index.php?$1=$2
 RewriteRule   ^/?([a-z0-9]+)            index.php?foobar=$1

```

so, something like `http://myDomain/wiki` is redirect to `index.php?foobar=wiki`, **but I need it with no redirection**, need Apache going to `/wiki`.

PS: I try some variations, and some changes into `index.php` (working with redirections internally), but need **elegant and secure Apache Rewrite solution, avoiding loops**.