By using this piece of .htaccess code you can redirect any visitor who is not at a selected IP address. You may use as many IP addresses or as few as you would like.
This is a very simple way to redirect visitors so they are unable to view your site. It is possible to redirect all visitors excluding yourself, co-workers, and even your clients.
- First, make a coming soon page named “comingsoon.html”, and then upload it to public_html.
- Then, add this to your .htaccess file
- RewriteEngine On
- RewriteBase /
- RewriteCond %{REMOTE_HOST} !^71.225.113.171
- RewriteCond %{REQUEST_URI} !/comingsoon.html$
- RewriteRule .* /comingsoon.html [R=302,L]