Content
To redirect everyone but you to another website, you should add this code to your .htaccess file:
1
2
3
4
|
RewriteEngine On
RewriteBase /
RewriteCond %{REMOTE_HOST} !^1.2.3.4
RewriteRule .* http://www.anothersite.com [R=302,L]
|
You can create/edit the .htaccess file using File Manager in cPanel, but make sure to replace the numbers 1.2.3.4with your actual IP address. You can find what your IP address is at:
https://whatismyip.com/
This will redirect all your visitors to http://www.anothersite.com except you.
You can achieve the same result by denying access to your website for everyone except you. All other visitors will be redirected to anothersite.com. The rules that should be added to your .htaccess file are:
1
2
3
4
|
ErrorDocument 403 http://www.anothersite.com
Order deny,allow
Deny from all
Allow from 1.2.3.4
|