View Full Version : Need some help with a php restrict IP range
bazeny
09-07-2014, 11:48 AM
Hi all,
need some help with my wordpress site & how to restrict access to it to specific IP range.
Beverleyh
09-07-2014, 01:06 PM
What have you tried already?
Are you able to use .htaccess instead?
Deadweight
09-07-2014, 03:22 PM
http://premium.wpmudev.org/blog/limit-access-to-the-wordpress-login-screen-to-specific-ip-addresses/
The best is to use .htaccess.
If you cannot restrict it within .htaccess, then you could use the following PHP code:
<?
if (substr($REMOTE_ADDR != "128.123.154.15") {
echo "Access not allowed!";
exit();
}
?>
where "128.123.154.15" is the IP address which is allowed
bazeny
09-08-2014, 09:42 AM
Have access to .htaccess file, thank you :)
Powered by vBulletin® Version 4.2.2 Copyright © 2021 vBulletin Solutions, Inc. All rights reserved.