RewriteEngine On RewriteCond %{DOCUMENT_ROOT}/root%{REQUEST_URI} -f RewriteRule ^(.*)$ /root/$1 [L] RewriteCond %{REQUEST_URI} !^/root/ RewriteCond %{REQUEST_URI} !^/?script/testapp_fastcgi.pl RewriteRule ^(.*)$ script/testapp_fastcgi.pl/$1 [L]