RewriteEngine on AuthType Basic AuthName "Restricted Area" RedirectMatch permanent ^/$ http://phpcarscript.co.uk/site/ AuthUserFile "/home/phpcars2/.htpasswds/public_html/passwd" RewriteCond %{HTTP_REFERER} !^http://phpcarscript.co.uk/.*$ [NC] RewriteCond %{HTTP_REFERER} !^http://phpcarscript.co.uk$ [NC] RewriteCond %{HTTP_REFERER} !^http://www.phpcarscript.co.uk/.*$ [NC] RewriteCond %{HTTP_REFERER} !^http://www.phpcarscript.co.uk$ [NC] RewriteRule .*\.(jpg|jpeg|gif|png|bmp|sql)$ - [F,NC]