annak
By:
annak

.htaccess deny from

March 10, 2014 2.8k views
This below in the new 'securer' wp/ubuntu site setup @ DO denies access to the site [from visitors] with internal server misconfiguration message. order allow,deny # start IP's deny from 146.0.73 deny from 146.0.74 deny from 146.0.78 deny from 146.0.79 deny from 5.39.218 deny from 5.39.219 allow from all This works fine on other sites I have hosted at DO. Whassup with that?
6 Answers
Apologies. Prior post was Beta!
Allow me to be absolutely precise so there's no confusion.

1) The .htaccess 'deny from' statements were placed in the website's root .htaccess file. And,

2) look exactly like this


order allow,deny
deny from 146.0.73
deny from 146.0.74
deny from 146.0.78
deny from 146.0.79
deny from 5.39.218
deny from 5.39.219
allow from all


And, to repeat, these work fine on my other DO hosted sites.
my gosh can't use angled brackets, can't get around DO's new folder security config. DO support says i'm in charge of site management and on and on.
Meanwhile all I want to do, in the spirit of DO hosting, is manage my own site security which is, now, not only wasting sooooo much of my time but is being dictated by DO - so, sometimes they want to manage and sometimes they don't. [Yes, I'm tired of this extreme time wasting, for me, new folder security solution].
ok, DO staff is correct anyways, we are responsible for our own VPSs because it is unmanaged service. so you have to do it on your own or hire someone to do it for you...

I started the same as you, and learned most of the stuff so there is no time wasting, but learning.

ok, so you want to secure your folder. That seems to me Apache rule you are trying to use.

Is that Apache + WP combination or what? or only Apache?

if you ever made changes to your site, always always restart Apache especially if make changes with configurations.

now the .htaccess should be similar to this:


Order Deny,Allow
deny from 146.0.73
deny from 146.0.74
deny from 146.0.78
deny from 146.0.79
deny from 5.39.218
deny from 5.39.219
Allow from all


make sure you enclose these rules inside the directory root like above.

and last always check the order of the rules. compare mine and yours to see the difference.

Good luck!!
is putting 'deny from' statements in WP/Ubuntu's /etc/apache2/ apache2.conf file better than putting them in .htaccess?

Except for 'page load time' does it make a difference?
It doesn't matter, I don't think it makes a difference.
every time i write and save any 'deny from' entry in my web's root .htaccess file then the whole site errors with a misconfiguration and never displays. For anyone.

Any ideas anyone?? thank you.
Have another answer? Share your knowledge.