How To Block Access to wp-config.php or .htaccess file

Linux, mySQL, PHP, Apache Questions, Tips, etc..

How To Block Access to wp-config.php or .htaccess file

Postby Steve » Sun Feb 27, 2011 7:34 pm

Just drop this code into your .htaccess file:

You could also just block everyone from accessing the wp-config file via browser with the following code in your .htaccess file:

Code: Select all
<files wp-config.php>
# Block access to wp-config
order allow,deny
deny from all
</files>


Blocking access to your .htaccess file is also a good idea:

Code: Select all
# Block access to htaccess
<files .htaccess>
order allow,deny
deny from all
</files>
- Steve Krause
groovyPost.com
User avatar
Steve
groovyPost Founder
groovyPost Founder
 
Posts: 978
Joined: Fri Sep 12, 2003 10:45 am

Re: How To Block Access to wp-config.php or .htaccess file

Postby bigbootyjj » Mon Oct 26, 2015 9:14 pm

John here and I know I'm far behind in reference to reply, but as for the code for blocking accesses, is there any specific location you'd suggest I place this onto a predominately php script? I know it's not supposed to be within a php script but was curious to know if it matters if I place them either above or in the middle or below all of them?

Sorry but kinda new in making websites and prefer Dreamweaver over other web-making services that come with restrictions.

Thanks,
John
bigbootyjj
Newbie
Newbie
 
Posts: 1
Joined: Mon Oct 26, 2015 9:05 pm
Location: Cleveland, OH


Return to Linux & Open Source

 


  • Related topics
    Replies
    Views
    Last post

Who is online

Users browsing this forum: No registered users and 2 guests