Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

htaccess order deny allow not working
New on LowEndTalk? Please Register and read our Community Rules.

htaccess order deny allow not working

n1kkon1kko Member

I'm using

Order Deny, Allow
Deny from 1.1.1.1
Deny from 2.2.2.2
Allow from all

But just getting 403 Forbidden

Comments

  • forthcloudforthcloud Member
    edited July 2014
    Order Allow, Deny
    Deny from 1.1.1.1
    Deny from 2.2.2.2
    Allow from all
    

    ForthCloud - True Cloud Servers (Virtuozzo/PCS)

  • n1kkon1kko Member

    Tried that and denied my IP but can still access the site.

  • Are you looking to deny all and just allow from certain IP's?

    theskyspace.com - Linux VPS Hosting Provider

  • BradBrad Member, Provider
    edited July 2014

    didn't read carefully - removed

  • perennateperennate Member, Provider

    What version of Apache are you using?

  • pavanpavan Member

    chmod htaccess file to 777
    if it works then allow chmod again as per actual requirements

  • n1kkon1kko Member

    Apache version is 2.2.27 I want to deny all and allow from my IP only. chmod 777 did not work thanks

  • @n1kko said:
    Apache version is 2.2.27 I want to deny all and allow from my IP only. chmod 777 did not work thanks

    Order Deny,Allow
    Deny from All
    Allow from YOURIPADDRESSHERE

    That should work

  • n1kkon1kko Member

    Still not working, I'm using cloudflare for my DNS maybe that's causing the issue

  • @n1kko said:
    Still not working, I'm using cloudflare for my DNS maybe that's causing the issue

    Have you enabled cloudflare? If you have, try disabling it

  • n1kkon1kko Member

    I have disabled and still no joy. Never had this issue before very strange

  • @n1kko said:
    I have disabled and still no joy. Never had this issue before very strange

    Could you show me the apache access and error log? (they're located at /var/log/apache)

  • n1kkon1kko Member

    If I change to this

    Order Deny,Allow
    allow from All 

    it works fine, just will not allow from my IP

  • n1kkon1kko Member

    No apache in /var/log/apache

  • n1kkon1kko Member

    running centos with cPanel

  • Really weird... Take a look here then if you're running cPanel: /usr/local/cpanel/logs/

    Apache logs should be there

  • nerouxneroux Member

    n1kko said: I want to deny all and allow from my IP only.

    Thats not what your original configuration seems to say.

  • n1kkon1kko Member

    found it at /usr/local/apach/logs this is the last few lines

    [Fri Jul 11 09:22:28 2014] [error] [client 1.1.1.1] request failed: URI too long (longer than 8190)
    [Fri Jul 11 09:22:28 2014] [error] [client 1.1.1.1] request failed: URI too long (longer than 8190)
    [Fri Jul 11 09:22:28 2014] [error] [client 1.1.1.1] request failed: URI too long (longer than 8190)
    [Fri Jul 11 09:22:28 2014] [error] [client 1.1.1.1] request failed: URI too long (longer than 8190)
    [Fri Jul 11 09:22:28 2014] [error] [client 1.1.1.1] request failed: URI too long (longer than 8190)
    [Fri Jul 11 09:22:28 2014] [error] [client 1.1.1.1] request failed: URI too long (longer than 8190)
    [Fri Jul 11 09:22:29 2014] [error] [client 1.1.1.1] request failed: URI too long (longer than 8190)
    [Fri Jul 11 09:22:29 2014] [error] [client 1.1.1.1] request failed: URI too long (longer than 8190)
    [Fri Jul 11 09:22:29 2014] [error] [client 1.1.1.1] request failed: URI too long (longer than 8190)
    [Fri Jul 11 09:22:29 2014] [error] [client 1.1.1.1] request failed: URI too long (longer than 8190)
    [Fri Jul 11 09:22:29 2014] [error] [client 1.1.1.1] request failed: URI too long (longer than 8190)
    [Fri Jul 11 09:22:29 2014] [error] [client 1.1.1.1] request failed: URI too long (longer than 8190)
    [Fri Jul 11 09:22:29 2014] [error] [client 1.1.1.1] request failed: URI too long (longer than 8190)
    [Fri Jul 11 09:22:29 2014] [error] [client 1.1.1.1] request failed: URI too long (longer than 8190)
    [Fri Jul 11 09:22:29 2014] [error] [client 1.1.1.1] request failed: URI too long (longer than 8190)
    [Fri Jul 11 09:22:29 2014] [error] [client 1.1.1.1] request failed: URI too long (longer than 8190)
    [Fri Jul 11 09:22:29 2014] [error] [client 1.1.1.1] request failed: URI too long (longer than 8190)
    [Fri Jul 11 09:22:29 2014] [error] [client 1.1.1.1] request failed: URI too long (longer than 8190)
  • Could you give me the logs when you use the following in the .htaccess file?

    Order Deny,Allow
    Deny from All
    Allow from YOURIPADDRESSHERE
  • n1kkon1kko Member
    edited July 2014

    Seems to be working now. I removed the domain from cloudflare and updated dns with domain provider so must be an issue with cloudflare

  • n1kkon1kko Member

    I can confirm this is a cloudflare issue. Tried with another domain and had to pause cloudflare first then re-enable

  • I told you to disable cloudflare -_-

  • nerouxneroux Member

    If you use Cloudflare it naturally wont work as your IP will never show up at the server.

  • n1kkon1kko Member

    Thanks for all the help :D

  • @n1kko said:
    I can confirm this is a cloudflare issue. Tried with another domain and had to pause cloudflare first then re-enable

    Did you have mod_cloudflare installed to restore visitor IP? That's the only reason I can think of as to why you have an issue with us on (our IPs will show without mod_cloudflare).

Sign In or Register to comment.