S
S
shurc2020-10-20 23:22:18
Apache HTTP Server
shurc, 2020-10-20 23:22:18

How to restrict access to a directory in .htaccess, but not for all files?

Good time of the day.
Tell me how to properly configure the htaccess file and make it so as to restrict access to the directory (make access by password), but at the same time leave free access to certain types of files?

For example, there is a directory for which you need to make password access
/mysite.com/www/ admin /

How to configure htaccess correctly so that when accessing files with the xml extension, a password is not required and access is free for everyone?

An example of a file location inside a child directory:
/mysite.com/www/ admin /xml_page/1/somefile-1223.xml

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
dodo512, 2020-10-21
@shurc

You can allow access to .xml by adding

<FilesMatch "\.xml$">
    Satisfy Any
</FilesMatch>

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question