The .htaccess must go inside the folder you want to protect, not your main site folder. Delete all that from your main .htaccess (except your 404 code), then place your admin files in a folder called, say, blogadmin. Then make a new .htaccess and paste the following code in it:
CODE
AuthName "Restricted Area"
AuthType Basic
AuthUserFile /var/www/.htpasswd
AuthGroupFile /dev/null
require valid-user
Also, you need to make sure the .htpasswd file contains the original username and encrypted password combination. The password should not be in plain text, otherwise you won't be able to log in.
...I just thought of something, actually. What version of Apache are you using (if indeed you are using Apache)? To find out, put the following code in a blank file and save it as anything with a .php extension. Upload it to your site and then visit the page:
CODE
<?php phpinfo(); ?>
Press CTRL+F (or Option F on Mac) and look for "Apache Version" (without quotes) on the page and tell us what it says. If it's anything other than 1.3.x then you may need to use a different password generator, as Apache 2 and above have different encryption settings.