0

I have tried to use

deny from all

So it blocks the whole contains and can be access by the page also..

Michael Victor
  • 861
  • 2
  • 18
  • 42
  • `Deny from all` did not work? Could you be more clear? You want to deny access but you *also* want to allow access somehow? – Clay Jan 11 '16 at 04:26
  • You can use `robot.txt` too. – Kausha Mehta Jan 11 '16 at 04:28
  • 1
    Possible duplicate of [deny direct access to a folder and file by htaccess](http://stackoverflow.com/questions/9282124/deny-direct-access-to-a-folder-and-file-by-htaccess) – Gaurav Rai Jan 11 '16 at 04:29

3 Answers3

0

Just create a blank index.html file and upload it to each folder. It's easier and safer..

Alex Moura
  • 21
  • 4
0

You can use the following code to deny access to the folder:

RedirectMatch 403 ^/folder/?$

just replace folder with name of the folder you want to deny access to.

To deny access to folder and files

You can use :

RedirectMatch 403 ^/folder/.+$

This will show forbidden error for the folder and files.

Amit Verma
  • 40,709
  • 21
  • 93
  • 115
0

Deny from all

Allow from all

This code is working under .htaccess to solve the above problem

Thanks guys for help...