eaponz
eaponz

Reputation: 604

Make a directory folder hidden or unreachable

This is my problem, I have a index.php which is my login form. I will explain my problem so it should not be complicated to understand.

I have a main folder inside it is I have a folder named templates and index.php so this is what it would look like

Main Folder

How can I make the templates folder unreachable so when any user types www.anysite.com/mainfolder/templates, the user can't see my templates folder or user cannot see my directory, or the user will be redirected to my Error Site.

Upvotes: 0

Views: 1152

Answers (3)

Aminu Bakori
Aminu Bakori

Reputation: 51

Create a .htaccess file and paste Redirect /mainfolder/ error-folder/403.php

Upvotes: 0

undone
undone

Reputation: 7888

Create a file named .htaccess in the folder with this content:

deny from all

Upvotes: 1

nickle
nickle

Reputation: 5196

try this in htaccess

<Files *>
 Deny from all
</Files> 

Upvotes: 0

Related Questions