Htaccess File

Adryi13/lineargent/master/.htaccess

DEFLATE, REQUEST_FILENAME, REQUEST_URI
RewriteEngine On

#Removes access to the system folder by users.
#'system' can be replaced if you have renamed your system folder.
RewriteCond %{REQUEST_URI} ^system.*
RewriteRule ^(.*)$ /index.php?/$1 [L]

#Checks to see if the user is attempting to access a valid file,
#such as an image or css document, if this isn't true it sends the
#request to index.php
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L]

<FilesMatch ".(ttf|otf|woff)$">
#Header set Access-Control-Allow-Origin "*"
</FilesMatch>

#enable compression
<IfModule mod_deflate.c>
    <filesMatch ".(js|css|html|php|xml|jpg|jpeg|png|svg|ttf|woff2|woff)$">
        SetOutputFilter DEFLATE
    </filesMatch>
</IfModule>

<IfModule mod_expires.c>
ExpiresActive on
    <Files index.html>
        Header append Cache-Control "public, must-revalidate"
    </Files>
    # cache images and flash content for one month
    <FilesMatch ".(flv|gif|jpg|jpeg|png|ico|swf|svg)$">
        Header set Cache-Control "max-age=2592000"
#        Header set Cache-Control "max-age=5"
    </FilesMatch>

    # cache text, css, and javascript files for one week
    <FilesMatch ".(js|css|pdf|txt)$">
        Header set Cache-Control "max-age=604800"
#        Header set Cache-Control "max-age=5"
    </FilesMatch>

    # cache html and htm files for one day
    <FilesMatch ".(html|htm)$">
        Header set Cache-Control "max-age=43200"
#        Header set Cache-Control "max-age=5"
    </FilesMatch>

    # implement minimal caching during site development
    <FilesMatch ".(flv|gif|jpg|jpeg|png|ico|js|css|pdf|swf|html|htm|txt|ttf)$">
#        Header set Cache-Control "max-age=604800"
#        Header set Cache-Control "max-age=5"
    </FilesMatch>

    # explicitly disable caching for scripts and other dynamic files
    <FilesMatch ".(pl|php|cgi|spl|scgi|fcgi)$">
        Header unset Cache-Control
    </FilesMatch>
</IfModule>
Exit mobile version