youssef_ mousa
youssef_ mousa

Reputation: 23

i want to block access to folder and its content php

i got folder called recordings on my server and i want to block access from anyone to it and its content and at the same time i want the ability to call the files inside the folder from other pages i tried htaccess rule

Options -Indexes

its just block access to the folder but when i write specific file inside the folder the browser open it and i do not want that and i tried another htaccess rule :

deny from all

but it make me not able to call the files on other pages and i want to be able to call them so can anyone help me ?

Upvotes: 1

Views: 77

Answers (1)

Abhishek Gurjar
Abhishek Gurjar

Reputation: 7476

Use below rule,

<Files ~ "*.php">
    order deny,allow
    deny from all
    allow from 127.0.0.1
</Files>

Upvotes: 1

Related Questions