V
V
Vlad_isLove2019-07-21 04:38:05
Apache HTTP Server
Vlad_isLove, 2019-07-21 04:38:05

How to deny access to all files by URL in a specific folder via root .htaccess?

It is necessary that it was forbidden to run PHP files in certain folders by URL. These PHP scripts are only used for requre and include, through other PHP files, so you need to hide them from users. The variant with a redirect through RewriteRule is not suitable. Putting the .htaccess file with "deny from all" in the folder you want to hide is also not. What other options might there be?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
deepin, 2019-07-21
@Vlad_isLove

Deny access to a folder
Deny access to a folder and everything inside it
RedirectMatch 403 ^/папка/.*$

L
Lynn "Coffee Man", 2019-07-21
@Lynn

The most correct way is to move these files outside the site root.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question