Jump to content


Redirect Visitors by IP Address

  • Please log in to reply
No replies to this topic

#1 Sipylus



  • Management
  • 29 posts

Posted 19 November 2011 - 09:04 PM

Add this php script in a php file and save in your old admin login location.

$administor = $_SERVER['REMOTE_ADDR'];
if (preg_match("/nnn.nnn.nnn.nnn/",$administor)) {
header('Location: http://www.domain.tld/secret/login.php');
} else {
header('Location: http://www.go.away');

When the php file is executed, it will redirect IP's that do not match.
This is useful if you forgot and typed in the old login location instead.

* Replace nnn.nnn.nnn.nnn with your ip address.

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users