If I wanted to send anyone visiting my site to say my twitter page is that possible and how would I exit the .htaccess file to do that?
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REMOTE_ADDR} !^12\.34\.56\.78$
RewriteRule ^.*$ http://www.twitter.com/ [R=302,L]
</IfModule>
<?php $allow = array("127.0.0.1");
if(!in_array($_SERVER['REMOTE_ADDR'], $allow) && !in_array($_SERVER["HTTP_X_FORWARDED_FOR"], $allow)) {
header("Location: http://www.example.com/");
exit();
} ?>
How can I add multiple IP addresses?For example, this htaccess code will redirect everyone to twitter except for your IP address:
Code:<IfModule mod_rewrite.c> RewriteEngine On RewriteCond %{REMOTE_ADDR} !^12\.34\.56\.78$ RewriteRule ^.*$ http://www.twitter.com/ [R=302,L] </IfModule>
Just enter your IP (which will not be redirected) and your twitter URL.
How can I add multiple IP addresses?
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REMOTE_ADDR} !^12\.34\.56\.78$
RewriteCond %{REMOTE_ADDR} !^11\.22\.33\.44$
RewriteCond %{REMOTE_ADDR} !^44\.33\.22\.11$
RewriteRule ^.*$ http://www.twitter.com/ [R=302,L]
</IfModule>
I used this but it is not redirecting to it.Code:<IfModule mod_rewrite.c> RewriteEngine On RewriteCond %{REMOTE_ADDR} !^12\.34\.56\.78$ RewriteCond %{REMOTE_ADDR} !^11\.22\.33\.44$ RewriteCond %{REMOTE_ADDR} !^44\.33\.22\.11$ RewriteRule ^.*$ http://www.twitter.com/ [R=302,L] </IfModule>
I used this but it is not redirecting to it.
We use essential cookies to make this site work, and optional cookies to enhance your experience.