RewriteEngine On #disallow access to ldclient files RewriteRule ^(.*)ldclient(.*)\.txt$ %{DOCUMENT_ROOT}/ldclient/ldclient.php?ldclient_error=403 [L] #default .html document handling RewriteCond %{REQUEST_FILENAME} -d RewriteCond %{REQUEST_FILENAME}index\.html -f RewriteRule ^$ %{DOCUMENT_ROOT}/ldclient/ldclient.php?ldclient_html_source=%{REQUEST_FILENAME}/index.html [L] #default .htm document handling RewriteCond %{REQUEST_FILENAME} -d RewriteCond %{REQUEST_FILENAME}index\.htm -f RewriteRule ^$ %{DOCUMENT_ROOT}/ldclient/ldclient.php?ldclient_html_source=%{REQUEST_FILENAME}/index.htm [L] #default .php document handling RewriteCond %{REQUEST_FILENAME} -d RewriteCond %{REQUEST_FILENAME}index\.php -f RewriteRule ^$ %{DOCUMENT_ROOT}/ldclient/ldclient.php?ldclient_php_source=%{REQUEST_FILENAME}/index.php [L,QSA] #html rewrite rules - for static pages RewriteRule ^(.*)\.html$ %{DOCUMENT_ROOT}/ldclient/ldclient.php?ldclient_html_source=%{REQUEST_FILENAME} [L] RewriteRule ^(.*)\.htm$ %{DOCUMENT_ROOT}/ldclient/ldclient.php?ldclient_html_source=%{REQUEST_FILENAME} [L] #php rewrite rules RewriteCond %{REQUEST_FILENAME} !^(.*)\/ldclient\.php(.*) RewriteRule ^(.*)\.php$ %{DOCUMENT_ROOT}/ldclient/ldclient.php?ldclient_php_source=%{REQUEST_FILENAME} [L,QSA]