Rewrite rule if condition is not matched

Apache’s RewriteCond as well as the RewriteRule directive support the exclamation mark to specify a non-matching pattern:

You can prefix the pattern string with
a ‘!’ character (exclamation mark) to
specify a non-matching pattern.

This should work:

RewriteCond %{REQUEST_URI} !^/forums.*
RewriteRule !\.(js|gif|css|jpg|png)$ /index.php [L]

–> redirect all requests not beginning with forums and not ending with the listed suffices to index.php

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)