fergardi/portfolio/master/web/.htaccess - Htaccess File

fergardi/portfolio/master/web/.htaccess

# PHP ERRORS
php_flag display_errors Off

# REWRITE URLS
<IfModule mod_rewrite.c>
    # Enable Rewriting
    RewriteEngine On
    # Explicitly disable rewriting for front controllers
    RewriteRule ^app_dev.php - [L]
    RewriteRule ^app.php - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    # Change below before deploying to production
    #RewriteRule ^(.*)$ app.php [QSA,L]
    RewriteRule ^(.*)$ app_dev.php [QSA,L]
</IfModule>

# EXPIRES CACHING
<IfModule mod_expires.c>
    # Enable Expires
    ExpiresActive On
    # Default *
    ExpiresDefault "now plus 1 month"
    # Manifest instant
    ExpiresByType text/cache-manifest "now plus 0 seconds"
    # HTML instant
    ExpiresByType text/html "now plus 0 seconds"
    # Data
    ExpiresByType text/xml "now plus 0 seconds"
    ExpiresByType text/xliff "now plus 0 seconds"
    ExpiresByType application/xml "now plus 0 seconds"
    ExpiresByType application/json "now plus 0 seconds"
    # Favicon
    ExpiresByType image/x-icon "now plus 1 week"
    # Media
    ExpiresByType image/gif "now plus 1 month"
    ExpiresByType image/png "now plus 1 month"
    ExpiresByType image/jpg "now plus 1 month"
    ExpiresByType image/jpeg "now plus 1 month"
    ExpiresByType video/ogg "now plus 1 month"
    ExpiresByType audio/ogg "now plus 1 month"
    ExpiresByType video/mp4 "now plus 1 month"
    ExpiresByType video/webm "now plus 1 month"
    # Fonts
    ExpiresByType font/truetype "now plus 1 month"
    ExpiresByType font/opentype "now plus 1 month"
    ExpiresByType application/x-font-woff "now plus 1 month"
    ExpiresByType image/svg+xml "now plus 1 month"
    ExpiresByType application/vnd.ms-fontobject "now plus 1 month"
    # CSS and JS
    ExpiresByType text/css "now plus 1 year"
    ExpiresByType application/javascript "now plus 1 year"
    ExpiresByType text/javascript "now plus 1 year"
</IfModule>

# HEADER CACHING
<ifModule mod_headers.c>
    # Media
    <FilesMatch ".(gif|ico|png|jpeg|jpg|css|woff|xliff)$">
    Header set Cache-Control "max-age=2592000, public"
    </FilesMatch>
    # JavaScript
    <FilesMatch ".(js)$">
    Header set Cache-Control "max-age=86400, private, must-revalidate"
    </FilesMatch>
</ifModule>

# DEFLATE COMPRESSION
<IfModule mod_deflate.c>
    AddOutputFilterByType DEFLATE text/plain
    AddOutputFilterByType DEFLATE text/html
    AddOutputFilterByType DEFLATE text/xml
    AddOutputFilterByType DEFLATE text/xliff
    AddOutputFilterByType DEFLATE text/css
    AddOutputFilterByType DEFLATE application/xml
    AddOutputFilterByType DEFLATE application/xhtml+xml
    AddOutputFilterByType DEFLATE application/rss+xml
    AddOutputFilterByType DEFLATE application/javascript
    AddOutputFilterByType DEFLATE application/x-javascript
</IfModule>

On Github License

Files

Download PDF of Htaccess file
DEFLATE, REQUEST_FILENAME

Comments

Apache