Protecting the /inc/ directory!

by Mr_Joker - 15-06-2015, 11:23 AM
YouR JuSt G4Y
Posts:
879
Joined:
Feb 2015
Likes:
31
Credits:
253
Reputation:
3
1 Year of Service
#1
OP
Posted: 15-06-2015, 11:23 AM
This little tip assumes you're using an Apache webserver. For NGINX/lighttpd/etc. you'll need to refer to your webserver's manual.


Firstly, create a file called htaccess.txt. This will be renamed later but due to files that are prefixed with a period being hidden by default this is the best method.

You want to edit this file with a text editor such as Notepad++ or even Notepad itself will do (Although not recommended) and put the following line at the top:
Code:
deny from all

Now simply save it and upload to the ./inc/ directory on your webhost. You will then need to rename it to .htaccess

You can test it's working by going to http://yoursite.com/inc/

If you receive a 403 error then everything is working as planned and is inaccessible to the real world.

Now all of your configurations and settings are protected just in case something is mis-configured server side.
@Believer rocks
Prime
Posts:
1,237
Joined:
May 2015
Likes:
37
Credits:
900
Reputation:
32
1 Year of Service
#2
Posted: 15-06-2015, 12:40 PM
Do You know why .htaccess gets hidden?

I want @mr_joker to answer please :3
The last reply on this thread is older than a month. Please do not unnecessarily bump it.
Register an account or login to reply
Create an account
Create a free account today and start posting right away. It only takes a few seconds.
Login
Log into an existing account.
1 Guest(s)