Skip to main content

Redirect bad referrers

Comments

3 comments

  • cPRex Jurassic Moderator
    Hey there! This is something where .htaccess is likely the best solution. Something like this would work to limit the access to one IP address. Just replace the 1.2.3.4 IP with the IP of the user that should have access: RewriteEngine on RewriteCond %{REQUEST_URI} ^(.*)?wp-login.php(.*)$ [OR] RewriteCond %{REQUEST_URI} ^(.*)?wp-admin$ RewriteCond %{REMOTE_ADDR} !^1.2.3.4$ RewriteRule ^(.*)$ " [R=403,L]
    Can you try that and see if that gets you the results you're looking for?
    0
  • jeffschips
    Thanks cPRex. Just to clarify when to say ". . . replace the 1.2.3.4 with the IP of the user that should have access", I'm a bit stumped. Do you mean the IP address of the apache server hosting the virtual hosts, or the party making the request - I will never know the ip address of the party making the request.
    0
  • cPRex Jurassic Moderator
    The "1.2.3.4" would actually be the end-user's IP you want to allow access for, not the IP that you're blocking access from.
    0

Please sign in to leave a comment.