I am attempting to redirect Web addresses from example.net/customname or example.net/customname/ to example.internet/my/home.php?username=customname . This by itself isn't complicated:

RewriteRule ^([a-zA-Z0-9_-]+)$ my/home.php?username=$1
RewriteRule ^([a-zA-Z0-9_-]+)/$ my/home.php?username=$1

However, I wish to exclude my existing sites and files, for example example.net/about/ and example.net/files. I can not quite learn how to use RewriteCond (will i need multiple rewrite conds?) to be able to exclude products like example.net/about/ from being rewritten to example.net/home.php?username=about. How do i do that?


EDIT: This is actually the exact solution...

    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^([a-zA-Z0-9_-]+)/?$ my/home.php?url=$1 [NC,L]

RewriteCond has some kind of special designs for exactly this purpose. Do this:

RewriteCond %REQUEST_FILENAME ! -d
RewriteCond %REQUEST_FILENAME ! -f
RewriteRule ^([a-zA-Z0-9_-]+)/?$ my/home.php?username=$1

Use a RewriteCond (rewrite condition), such as this:

RewriteCond %{REQUEST_URI} ! ^\/(about|files)\/?$
RewriteRule ^([a-zA-Z0-9_-]+)/?$ my/home.php?username=$1 [L]

This could effectively only apply the rule whether it will get through all of the conditions above it, much like using if claims.