Have a little issue that i hope someone can help me out with. I have a WordPress website that i only want to grant employee’s access to. So I’d like to use a HTTP Referer so that way i can add a link from our intranet site, kind of like this…

if (strpos($_SERVER["HTTP_REFERER"],'') == true) 
 echo "/";
 header( 'Location:' ) ;

However i would also like to add a list of trusted ip addresses, using the following code…

$allowlist = array(


What would be the easiest way to combine this code? Or is there a better way i should be doing this?

Hope this all makes sense, if not let me know if i need to clarify on anything.

Apologize for my lack of coding ability, still learning the ropes. Any help at all would be great appreciated.

Read more here: HTTP_REFERER & REMOTE_ADDR Combined

Leave a Reply

Your email address will not be published. Required fields are marked *