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

Recommended Posts

Steve    1,649

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:


# Block access to wp-config
order allow,deny
deny from all


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


# Block access to htaccess

order allow,deny
deny from all

Share this post

Link to post
Share on other sites
bigbootyjj    0

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.




Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Who's Online   0 Members, 0 Anonymous, 15 Guests (See full list)

    There are no registered users currently online