Skip to content
  • Home
  • About

WP Snippets and Tutorials

New WordPress Tricks, Tutorials and Snippets

How to Protect wp-config.php with .htaccess

 Posted in Wordpress Security

How to Protect wp-config.php with .htaccess

 NewWPTricks.com  April 21, 2014  Leave a Comment on How to Protect wp-config.php with .htaccess

Adding below snippet into your .htaccess file will prevent access to your wp-config.php file:

<Files wp-config.php>
 Order Allow,Deny
 Deny from all
</Files>
Share: TwitterFacebookRedditVKDiggLinkedinMix
Tagged htaccess, wp-config.php

Post navigation

How to Load jQuery from Google CDN →
← How to Hide/Remove Admin Toolbar Bar in WordPress

Recent Posts

  • How to Fix Underscore Theme Title Error with Theme-Check Plugin
  • How to Add Hotlink Protection using .htaccess in WordPress
  • How to Block Visitors using .htaccess in WordPress
  • How to Hide Upgrade Notice from WordPress Dashboard
  • How to Hide/Remove Admin Toolbar Bar in WordPress

Copyright © 2025 WP Snippets and Tutorials

Design by ThemesDNA.com