Htaccess File

andrroy/Cosmo/master/.htaccess

DEFLATE, no-gzip, QUERY_STRING, REQUEST_FILENAME, REQUEST_URI
<IfModule mod_rewrite.c>

    Options -MultiViews

    # Core
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_URI} !^/uploads/
    RewriteRule ^ index.php [QSA]

    # API
    RewriteCond %{REQUEST_URI} ^/api/
    RewriteRule ^ core/app/api.php [QSA]

    # HTML snapshots for search engines
    RewriteCond %{REQUEST_URI}  ^/$
    RewriteCond %{QUERY_STRING} ^_escaped_fragment_=/?(.*)$
    RewriteRule ^(.*)$ /core/app/compile.php?url=%1? [NC,L]

</IfModule>

<IfModule mod_deflate.c>
    # The following line is enough for .js and .css
    AddOutputFilter DEFLATE js css
    AddOutputFilterByType DEFLATE text/plain text/xml application/xhtml+xml text/css   application/xml application/rss+xml application/atom_xml application/x-javascript application/x-httpd-php application/x-httpd-fastphp text/html

    # The following lines are to avoid bugs with some browsers
    BrowserMatch ^Mozilla/4 gzip-only-text/html
    BrowserMatch ^Mozilla/4.0[678] no-gzip
    BrowserMatch bMSIE !no-gzip !gzip-only-text/html

    # Compress .svg files
    AddType image/svg+xml .svg
    AddOutputFilterByType DEFLATE image/svg+xml
</IfModule>

<IfModule mod_expires.c>
    ExpiresActive On
    ExpiresDefault "access plus 10 days"
    ExpiresByType text/css "access plus 1 week"
    ExpiresByType text/plain "access plus 1 month"
    ExpiresByType image/gif "access plus 1 month"
    ExpiresByType image/png "access plus 1 month"
    ExpiresByType image/jpeg "access plus 1 month"
    ExpiresByType application/x-javascript "access plus 1 month"
    ExpiresByType application/javascript "access plus 1 week"
    ExpiresByType application/x-icon "access plus 1 year"
</IfModule>

<IfModule mod_headers.c>
    <FilesMatch ".(js|css|xml|gz)$">
        Header append Vary Accept-Encoding
    </FilesMatch>
    <FilesMatch ".(ico|jpe?g|png|gif|swf)$">
        Header set Cache-Control "public"
    </FilesMatch>
    <FilesMatch ".(css)$">
        Header set Cache-Control "public"
    </FilesMatch>
    <FilesMatch ".(js)$">
        Header set Cache-Control "private"
    </FilesMatch>
    <FilesMatch ".(x?html?|php)$">
        Header set Cache-Control "private, must-revalidate"
    </FilesMatch>
</IfModule>
Exit mobile version