Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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
</files>

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

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 superuser.com 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

2 Answers 2

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:

http://yoursite.com/wp-site/.htaccess
http://yoursite.com/wp-site/wp-config.php

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

 
discard

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