Sometimes you need to put your web site to maintenace mode or simply to block anyone access it while you are working or making changes on it but you also need access it to make those changes
To do this you add the following lines in the .htaccess file into your public_html directory.
RewriteEngine on RewriteCond %{REQUEST_URI} !/maintenance.html$ RewriteCond %{REMOTE_HOST} !^000\.000\.000\.000 RewriteRule $ /maintenance.html [R=302,L]
In the 3rd line you can change the 000 values for your connection IP, this way you will be able to access the site. Anyone esle trying to access your site will be redirected to the maintenance.html page.
Note: You should create the maintenance page (maintenance.html), you can name it as you wish, make sure to change it accordingly in the lines above.