0

How can I deny access particular WordPress site page using a .htaccess file?

The URL to the file is: https://www.mhi-ipt.in/error/README.

The above page information came from where Apache server or elsewhere I guess.

I can't seem to find a way to disable this, probably because I'm using a shared hosting server.

How can I achieve that?

4
  • Can you take your time and rephrase your post? As it stands, it is not quite clear what your challenge is(are) and what you are trying to achieve. Feb 24, 2017 at 9:35
  • how to disable this informations because the site auditing team told me totally disable without site affecting so how to overcome this plz advice me.. @nyedidikeke sir.. Feb 24, 2017 at 9:46
  • Any update(s) using the updated solution right here? Feb 24, 2017 at 11:12
  • Can you please file an edit to your question – instead of commenting? And please, get some friend who speaks English well to help you with that. Thanks!
    – kaiser
    Feb 24, 2017 at 12:14

1 Answer 1

1

You can prevent access to the file in question by modifying your .htaccess file or creating one, should you have none, with content as follow:

# BEGIN Prevent access to README
<Files "README">
    order allow, deny
    deny from all
</Files>
# END Prevent access to README

Please note: your .htaccess file should be located in the same directory as the file in question; either: in your error folder.

16
  • that error file is outside of the wordpress directory, so changing the wordpress htaccess will not help Feb 24, 2017 at 10:12
  • @MarkKaplun: can you please elaborate? What do you suggest then? I don't see how modifying a .htaccess file and/or creating one wouldn't address this challenge. This seem to me a non-WordPress dominant challenge by the way. Feb 24, 2017 at 10:14
  • hmm maybe I didn't understand the question.... but errors usually are generated on web server configuration level. so it depends if the htaccess can even modify access to the error, and if the site is even in the root. If the site is on a subdirectory than no htaccess changes to the file generated by wordpress will be able to help here as htaccess only have impact on the directory in which it is located and its sub directories Feb 24, 2017 at 10:19
  • looking at it properly I see it is a web server generated page. retracted the downvote, but this answer is most likely wrong, or not the best way to do it Feb 24, 2017 at 10:22
  • 1
    @muprabakaran, I don't get it, maybe you should share the directory structure of your root directory. If you don't have the access to the directory /error, then you won't be able to setup .htacess in the directory either. Maybe you should contact your hosting company if that's the case, your problem not really related to WordPress then.
    – hcheung
    Feb 24, 2017 at 11:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.