45 lines
1.3 KiB
ApacheConf
45 lines
1.3 KiB
ApacheConf
<IfModule mod_rewrite.c>
|
|
<IfModule mod_negotiation.c>
|
|
Options -MultiViews -Indexes
|
|
</IfModule>
|
|
|
|
RewriteEngine On
|
|
|
|
# Handle Authorization Header
|
|
RewriteCond %{HTTP:Authorization} .
|
|
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
|
|
|
|
# Redirect Trailing Slashes If Not A Folder...
|
|
RewriteCond %{REQUEST_FILENAME} !-d
|
|
RewriteCond %{REQUEST_URI} (.+)/$
|
|
RewriteRule ^ %1 [L,R=301]
|
|
|
|
# Handle Front Controller...
|
|
RewriteCond %{REQUEST_FILENAME} !-d
|
|
RewriteCond %{REQUEST_FILENAME} !-f
|
|
RewriteRule ^ index.php [L]
|
|
</IfModule>
|
|
|
|
# Disable index view
|
|
Options -Indexes
|
|
|
|
# Hide a specific file
|
|
<Files ~ "\.(env|json|config.js|md|gitignore|gitattributes|lock)$">
|
|
Order allow,deny
|
|
Deny from all
|
|
</Files>
|
|
|
|
## EXPIRES CACHING ##
|
|
<IfModule mod_expires.c>
|
|
ExpiresActive On
|
|
ExpiresByType image/jpg "access plus 1 year"
|
|
ExpiresByType image/jpeg "access plus 1 year"
|
|
ExpiresByType image/gif "access plus 1 year"
|
|
ExpiresByType image/png "access plus 1 year"
|
|
ExpiresByType text/css "access plus 1 month"
|
|
ExpiresByType text/x-javascript "access plus 1 month"
|
|
ExpiresByType application/x-shockwave-flash "access plus 1 month"
|
|
ExpiresByType image/x-icon "access plus 1 year"
|
|
ExpiresDefault "access plus 1 days"
|
|
</IfModule>
|