tobymackenzie/Symfony-Initial/0.7.x/web/.htaccess - Htaccess File

tobymackenzie/Symfony-Initial/0.7.x/web/.htaccess

##=====
#=browser specific
#=====#
# Force the latest IE version, in various cases when it may fall back to IE7 mode
# github.com/rails/rails/commit/123eb25#commitcomment-118920
# Use ChromeFrame if it's installed for a better experience for the poor IE folk
<IfModule mod_headers.c>
  Header set X-UA-Compatible "IE=Edge,chrome=1"
  # mod_headers can't match by content-type, but we don't want to send this header on *everything*...
  <FilesMatch ".(js|css|gif|png|jpe?g|pdf|xml|oga|ogg|m4a|ogv|mp4|m4v|webm|svg|svgz|eot|ttf|otf|woff|ico|webp|appcache|manifest|htc|crx|oex|xpi|safariextz|vcf)$" >
    Header unset X-UA-Compatible
  </FilesMatch>
</IfModule>

##=====
#=symfony -@ from symfony standard
#=====#

##==send home page through app.php automatically.  reduce lookups for other indexes
DirectoryIndex app.php

<IfModule mod_rewrite.c>
  RewriteEngine On

  ##==help handle app being served from subdirectory
  # RewriteCond %{REQUEST_URI}::$1 ^(/.+)/(.*)::2$
  # RewriteRule ^(.*) - [E=BASE:%1]

  ##==remove 'app.php' from URL to prevent duplicate content
  RewriteCond %{ENV:REDIRECT_STATUS} ^$
  RewriteRule ^app.php(/(.*)|$) %{ENV:BASE}/$2 [R=301,L]

  ##==serve files and directories
  RewriteCond %{REQUEST_FILENAME} -f
  RewriteRule .? - [L]
  RewriteCond %{REQUEST_FILENAME} -d
  RewriteRule .? - [L]

  ##==all other routes go through symfony
  RewriteRule .? %{ENV:BASE}/app.php [L]
</IfModule>
<IfModule !mod_rewrite.c>
  <IfModule mod_alias.c>
    ##==temporary fallback if mod_rewrite isn't available.  URLs will show with 'app.php' prepended
    RedirectMatch 302 ^/$ /app.php/
  </IfModule>
</IfModule>
##==disable Multiviews to prevent '/app' from resolving to '/app.php'
<IfModule mod_negotiation.c>
  Options -MultiViews
</IfModule>

##==compression
#--compress text files
#-@ https://github.com/h5bp/server-configs-apache/blob/master/src/web_performance/compression.conf
<IfModule mod_deflate.c>
  <IfModule mod_filter.c>
    AddOutputFilterByType DEFLATE 'application/atom+xml' 
      'application/javascript' 
      'application/json' 
      'application/ld+json' 
      'application/manifest+json' 
      'application/rdf+xml' 
      'application/rss+xml' 
      'application/schema+json' 
      'application/vnd.geo+json' 
      'application/vnd.ms-fontobject' 
      'application/x-font-ttf' 
      'application/x-javascript' 
      'application/x-web-app-manifest+json' 
      'application/xhtml+xml' 
      'application/xml' 
      'font/eot' 
      'font/opentype' 
      'image/bmp' 
      'image/svg+xml' 
      'image/vnd.microsoft.icon' 
      'image/x-icon' 
      'text/cache-manifest' 
      'text/css' 
      'text/html' 
      'text/javascript' 
      'text/plain' 
      'text/vcard' 
      'text/vnd.rim.location.xloc' 
      'text/vtt' 
      'text/x-component' 
      'text/x-cross-domain-policy' 
      'text/xml'
  </IfModule>
</IfModule>

On Github License

Files

Download PDF of Htaccess file
DEFLATE, ENV, REDIRECT_STATUS, REQUEST_FILENAME, REQUEST_URI

Comments

Apache