How to redirect all visitors except your IP to another website?

If you need to redirect your visitors to another website, but still be able to access your website from your IP, then you can consider doing that in your .htaccess file.

Assuming you are using one of our templates, your .htacess file will be located in the public_html folder of your server. It may also look like "htaccess.txt" in which case you need to rename it to ".htaccess".

Then it's just a matter of adding the following: 

RewriteEngine On
RewriteBase /
RewriteCond %{REMOTE_HOST} !^122.333.444.555
RewriteRule .* [R=301,L]

You should replace the numbers 122.333.444.555 with the numbers of your actual IP address! You can find what your IP address via or you can just Google 'Whats my IP' and Google will tell you :)

This will redirect all your visitors to except you.

If you want to find out more about what 301 or 302 redirect types mean, read more here.
  • 2 Users Found This Useful
Was this answer helpful?