I have an otherwise happily working server on Ubuntu 14.04. I'm trying to restrict access to a file using an allow/deny block:
<Files "login.php">
order deny,allow
deny from all
allow from 22.123.123.12
</Files>
This successfully denies all users and tells them "Forbidden. You don't have permission to access...". If I remove the "deny from all" line, it allows me to view the login screen.
But no matter what I do, and debug, I can't get it to let me view this file, when I'm using this IP address. The 'allow' statement never seems to work.
Some debugging already tried:
- I tried adding an
AllowOverride All
into my host configuration to make sure that the file/authorisation module itself was working. - I've tried a bunch of other allow/deny statements
- This statement is currently in an .htaccess file, but I've tried moving it into the host configuration, which also doesn't work.
Other possibly relevant info:
- I've used a bit of PHP to output my IP on a webpage: it is successfully recognised as being 22.123.123.12.
- I'm using SSL for the webpage, so I'm accessing the file at https://example.com/login.php. Not sure if that would affect things.
I'm starting to suspect that for some reason the server doesn't think I'm at this IP address, but can't figure out how that would be the case. Any ideas?