Allow your IP only to access a site

add this code on your .htaccess file

order deny,allow
deny from all
allow from xxx.xxx.xxx.xxx

where xxx.xxx.xxx.xxx is your ip address