Jump to content
groovyPost Forums

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


Steve Krause

Recommended Posts

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

Link to comment
Share on other sites

  • 4 years later...

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

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

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

    • There are no registered users currently online
×
×
  • Create New...