WordPress.org

Ready to get started?Download WordPress

Forums

Trying to limit access to development site by IP via htaccess (4 posts)

  1. Ate Up With Motor
    Member
    Posted 6 months ago #

    Hi,

    I have a WordPress development site that I want to be accessible only to my IP address. I've been trying to do this via htaccess, but I can't get it to work.

    First, I tried this:

    # ALLOW USER BY IP
    <Limit GET POST>
     order allow,deny
     allow from 1.2.3.4
     deny from all
     </Limit>

    Then I tried this:

    # ALLOW USER BY IP
    <Limit GET POST>
     order deny,allow
     deny from all
     allow from 1.2.3.4
     </Limit>

    (Obviously, my IP address is not actually 1.2.3.4!)

    Both of these locked me out -- 403 Forbidden. What am I doing wrong? (Yes, I did double-check my IP address.)

    Thanks!

  2. WPRanger
    Member
    Posted 6 months ago #

    I use:

    order deny,allow
    deny from all
    allow from xxx.xxx.xxx.xxx
    allow from xxx.xxx.xxx.xxx
    
    ErrorDocument 403 "<center><h2>Access Denied</h2></center>"
  3. Ate Up With Motor
    Member
    Posted 6 months ago #

    See, I tried that as well (without the custom ErrorDocument) and it still locks me out.

  4. WPRanger
    Member
    Posted 6 months ago #

    Can you see the server logs at your host. I'd check to see what's happening and also confirm your IP address.

Reply

You must log in to post.

About this Topic