Reputation: 760
I have a directory structure in which my "private" (bin...) folders are in the same directory as my public HTML (I can't elevate them above that due to a conflict with another site.) I'm trying to get .htaccess to deny all access to the folder, UNLESS the computer trying to access the files is the server itself.
My current .htaccess, in the bin directory:
Order Deny,Allow
Deny from all
Allow from anonpost.me
Allow from www.anonpost.me
Allow from 173.254.28.94
Allow from 127.0.0.1
Allow from aviatex14.co.uk/anonpost
Allow from www.aviatex14.co.uk/anonpost
Allow from jbblog.all12.org/anonpost
Allow from www.jbblog.all12.org/anonpost
Allow from 173.254.28.94/anonpost
Stops the bin files being loaded at all, and generates this error on the /bin directory:
[an error occurred while processing this directive]
Anyone know what I could use in my .htaccess?
Thanks in advance!:)
Upvotes: 3
Views: 8268
Reputation: 3638
Change to "Order Allow, Deny" so the allow lines are processed first, then delete the "Deny from all" line.
See htaccess "order" Deny, Allow, Deny for more information (not exactly a duplicate post, but very similar)
You also cannot specify a URL in your rules, just host names, so the /anonpost lines are causing the errors.
Upvotes: 3