formwork/.htaccess
2021-07-20 16:30:15 +02:00

28 lines
805 B
ApacheConf

AddDefaultCharset utf-8
<IfModule mod_mime.c>
AddCharset utf-8 .css .js .svg
</IfModule>
<IfModule mod_rewrite.c>
## Enable rewrite rules
RewriteEngine on
## Prevent direct access to Formwork folders but allow access to assets
RewriteRule ^site/templates/assets/.* - [L]
RewriteRule ^admin/(assets|avatars)/.* - [L]
RewriteRule ^(admin|backup|cache|formwork|site|vendor)/.* index.php [L]
## Prevent access to specific files
RewriteRule ^(.*)\.(md|yml|json)/?$ index.php [L]
RewriteRule ^(\.(.*)|LICENSE|composer\.lock)/?$ index.php [L]
## Let all URI be processed by index.php
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^.* index.php
</IfModule>
## Disable access to directory indexes
Options -Indexes