S
S
Sazanovdm2020-12-04 23:55:39
htaccess
Sazanovdm, 2020-12-04 23:55:39

What function/meaning does this expression serve?

Found the following in my .htaccess file:

# Prevent Direct Access to files
<FilesMatch "(?i)((\.tpl|\.ini|\.log|(?<!robots)\.txt))">
 Order deny,allow
 Deny from all
</FilesMatch>


I do not quite understand the meaning and meaning of this line.

The problem I faced: I have theme.init.js files on the server and because of this line. in htaccess, the file cannot be accessed, and as a result, the necessary code is not executed.

Question: Why is this expression needed in htaccess and how to add an exception for *.init.jsfiles?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
dodo512, 2020-12-05
@Sazanovdm

This rule prohibits access to files with extensions tpl, ini, log and txt except for robots.txt

<FilesMatch "(?i)((\.tpl|\.ini|\.log|(?<!robots)\.txt))">

It looks like the end of the line is missing here $
needs to be fixed
<FilesMatch "(?i)((\.tpl|\.ini|\.log|(?<!robots)\.txt))$">

So the template will not capture the *.init.jsfiles.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question