AuthType Basic RewriteEngine On RewriteCond %{HTTP_REFERER} !^http://www.domain.com [NC] RewriteRule /* http://www.domain.com/index.html [R,L]