Hello. I need some help with mod rewrite, the redirects are more complicated but I will try to simplify a bit... I have more domains hosted on a main site's directory. Domains on drive are hosted under main site like this: /domains/domain1.com/ /domains/domain2.com/ I am editing the .htaccess in main site and what I want is the rule to test if file index.php exists in the domain directory, and if not then show content of /domains/index.php something like: RewriteCond if !file_exists /domains/(THE_DOMAIN)/index.php RewriteRule ^domains/([^/]*)/$ /domains/index.php?domain=$1 How do I write that ? Thanks.