L
L
Leonid Rezvitsky2017-07-02 19:22:13
htaccess
Leonid Rezvitsky, 2017-07-02 19:22:13

How to open access to folders?

Here is what I have in htaccess:

RewriteEngine on
RewriteCond %{HTTP:X-Forwarded-Proto} !=https
RewriteRule .* https://%{SERVER_NAME}%{REQUEST_URI} [R=301,L]
AddDefaultCharset UTF-8
RewriteBase /
Options All -Indexes
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^resource/(.*)$ resource/$1 [L]
RewriteRule ^.*$ [NC,L]
AddType application/x-httpd-php .php .html .css
<IfModule mod_headers.c>
    Header unset ETag
</IfModule>
<FilesMatch "\.(flv|ico|pdf|avi|mov|ppt|doc|mp3|wmv|wav)$">
Header set Cache-Control "max-age=31536000, public"
</FilesMatch>
<FilesMatch "\.(jpg|jpeg|png|gif|swf)$">
    Header set Cache-Control "max-age=2629743, public"
</FilesMatch>
<FilesMatch "\.(txt|xml|js|css)$">
    Header set Cache-Control "max-age=604800, public"
</FilesMatch>
<FilesMatch "\.(html|htm|php|cgi|pl)$">
Header set Cache-Control "max-age=0, private, no-store, no-cache, must-revalidate"
</FilesMatch>
RewriteRule ^.*$ index.php [NC,L]

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question