
How to Obstruct Files That Can Expose Your WordPress Information
- March 30, 2016
- Leave a comment
Nowadays, bloggers are on their way to compete each other in different ways. But while being in competition, they don’t care about the security measures of a common WordPress site that should be implemented on their web application. Reason being the majority of them are non-technical and subsequently don’t think about any measure related to the security. That is why, hackers exploit this lack of security and misuse their private information at different platforms.
Let’s discuss about hiding or obstructing the readme.html file from the users, so they can’t see the data/information in that file. Readme file contains the information related to your upgraded WordPress version. It is necessary to hide/block these files from the users.
Following is the code to hide the different files from users that will block their access:
1 2 3 4 5 6 |
# Hide/Block files for public use <FilesMatch "^(wp-config\.php|php\.ini|php5\.ini|readme\.html|license\.txt|bb-config\.php|xmlrpc\.php)"> Order Allow,Deny Deny from all </FilesMatch> |
Place the above chunk of code into your .htaccess file located in the root directory. This code will block the access of the files listed below:
- wp-config.php
- php.ini
- php5.ini
- readme.html
- license.txt
- bb-config.php
- xmlrpc.php
If you want to keep access of the above mentioned files at your end only then you should add the following line in your code:
1 |
Allow from 11.22.33.44 |
You have to mentioned your IP address in this line to access files at your end. Now your final code will be:
1 2 3 4 5 6 7 |
# Hide/Block files for public use <FilesMatch "^(wp-config\.php|php\.ini|php5\.ini|readme\.html|license\.txt|bb-config\.php|xmlrpc\.php)"> Order Allow,Deny Deny from all Allow from 11.22.33.44 </FilesMatch> |
User Comments