Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Following some guide on the web, I have created the following .htaccess for my WordPress installation:

# protect the htaccess file
<files .htaccess>
order allow,deny
deny from all

# protect wpconfig.php
<files wp-config.php>
order allow,deny
deny from all

plus chmod wp-config.php 600 and .htaccess 644.

Which is the simplest way I can test if it is working properly? In case, I can create some other files to verify the work. I only want to be sure.

share|improve this question

migrated from Mar 8 '10 at 16:49

This question came from our site for computer enthusiasts and power users.

Programming questions should be asked on Stackoverflow. Server questions should be asked on Serverfault. I'm not sure which this is, but it's not a Superuser question. – Josh K Mar 8 '10 at 15:50
Actually @Josh, home server administration is typically accepted on SU. SF is geared towards IT pros who manage servers in a professional capacity. – heavyd Mar 8 '10 at 16:28
I thought that any file starting with ".ht" (like .htaccess or .htpasswd) was hidden by default with Apache (but I could be wrong). – squircle Mar 8 '10 at 16:37
Still think that you might get better results on SF. – Kevin M Mar 8 '10 at 16:39

If you want to test this from outside your network - as if you are a normal person across the internet, you can try using a proxy server such as Hidemyass or Proxify.

share|improve this answer

To test if the directives are working, just try browsing to the files:

When accessing the files you should get an error page. Try removing the directives and test again, see that a valid page will load.-

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.