smayzes/yii-template/master/.htaccess - Htaccess File


RewriteEngine on
RewriteBase /

# if a directory or a file exists, use it directly
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .* index.php [L]

# use utf-8 encoding for anything served text/plain or text/html
AddDefaultCharset utf-8
# force utf-8 for a number of file formats
AddCharset utf-8 .html .css .js .xml .json .rss
php_value default_charset utf-8

# Force the latest IE version, in various cases when it may fall back to IE7 mode
# Use ChromeFrame if it's installed for a better experience for the poor IE folk
<IfModule mod_setenvif.c>
  <IfModule mod_headers.c>
    BrowserMatch MSIE ie
    Header set X-UA-Compatible "IE=Edge,chrome=1" env=ie

# allow access from all domains for webfonts
# alternatively you could only whitelist
#   your subdomains like ""
<FilesMatch ".(ttf|otf|eot|woff|font.css)$">
  <IfModule mod_headers.c>
    Header set Access-Control-Allow-Origin ""

# webfonts
AddType application/  eot
AddType font/truetype                  ttf
AddType font/opentype                  otf
AddType font/woff                      woff

# these are pretty far-future expires headers
# they assume you control versioning with cachebusting query params like
#   <script src="application.js?20100608">
# additionally, consider that outdated proxies may miscache

# if you don't use filenames to version, lower the css and js to something like
#   "access plus 1 week" or so

<IfModule mod_expires.c>
  Header set Cache-Control "no-cache, no-store, must-revalidate"
  Header set Pragma "no-cache"
  Header set Expires 0

# Since we're sending far-future expires, we don't need ETags for
# static content.
FileETag None

# We don't need to tell everyone we're apache.
ServerSignature Off

On Github License


Download PDF of Htaccess file
no-cache, Pragma, REQUEST_FILENAME, static