RewriteEngine on AuthType Basic AuthName "Restricted Area" RedirectMatch permanent ^/$ http://www.phpcarscript.com/ AuthUserFile "/home/phpcars/.htpasswds/public_html/passwd" RewriteCond %{HTTP_HOST} ^.*$ RewriteRule ^demo/?$ http://www.phpcarscript.com/demo/ [R=301,L]