This is .htaccess code Shawn provided and Id like to alter it for one of my sites: <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} ^(.*).htm [NC,OR] RewriteCond %{REQUEST_FILENAME} ^(.*).html [NC] RewriteRule ^(.*) /passthru.php?file=$1 </IfModule> Code (markup): I plan to put .htaccess in main root folder (public_html) but as structure of all my (visible, online, not protected, crawable or however you want) pages is like this: public_html/abcd/index.html public_html/efgh/index.html i want to sent all subfolder/index.html's to public_html/passthru.php (or www.site.com/passthru.php, if relative path is impossible to use), nothing else. My question is how .htaccess should look to exclude anything that doesnt fit to that subdomain/index.html structure (no sending of any files sitting in root to passthru.php, just the ones sitting in subfolders and having exact name of index.html)?