Options FollowSymLinks -Indexes -MultiViews
DirectoryIndex index.php
# Force execution of .php scripts as PHP version 5.
# Uncomment the next line line if your server has PHP 4 as default:
#AddHandler php5-script php
# MIME-types and file handling
AddType video/ogg ogg ogv
AddType video/mp4 mp4
AddType video/webm webm
AddType font/truetype ttf
AddType font/opentype otf
AddType font/woff woff
AddType application/vnd.ms-fontobject eot
AddType application/vnd.openxmlformats docx pptx xlsx
AddType application/x-ms-application application
AddType application/x-chrome-extension crx
AddType text/cache-manifest manifest
AddType text/x-component htc
AddType image/vnd.microsoft.icon ico
AddType image/webp webp
AddType image/svg+xml svg svgz
AddEncoding gzip svgz
AddDefaultCharset utf-8
AddCharset utf-8 .html .css .js .xml .json .rss
# File compression
AddOutputFilterByType DEFLATE text/html text/plain text/css application/json
AddOutputFilterByType DEFLATE text/javascript application/javascript application/x-javascript
AddOutputFilterByType DEFLATE text/xml application/xml text/x-component
SetOutputFilter DEFLATE
# Cache expiration
Header set Cache-Control "public"
ExpiresActive on
ExpiresDefault "access plus 1 week"
ExpiresByType text/cache-manifest "access plus 0 seconds"
ExpiresByType text/html "access plus 0 seconds"
ExpiresByType text/xml "access plus 0 seconds"
ExpiresByType application/xml "access plus 0 seconds"
ExpiresByType application/json "access plus 0 seconds"
ExpiresByType application/rss+xml "access plus 1 hour"
ExpiresByType image/vnd.microsoft.icon "access plus 1 week"
ExpiresByType image/gif "access plus 1 month"
ExpiresByType image/png "access plus 1 month"
ExpiresByType image/jpg "access plus 1 month"
ExpiresByType image/jpeg "access plus 1 month"
ExpiresByType video/ogg "access plus 1 month"
ExpiresByType audio/ogg "access plus 1 month"
ExpiresByType video/mp4 "access plus 1 month"
ExpiresByType video/webm "access plus 1 month"
ExpiresByType font/truetype "access plus 1 month"
ExpiresByType font/opentype "access plus 1 month"
ExpiresByType font/woff "access plus 1 month"
ExpiresByType image/svg+xml "access plus 1 month"
ExpiresByType application/vnd.ms-fontobject "access plus 1 month"
ExpiresByType text/css "access plus 1 month"
ExpiresByType text/javascript "access plus 1 month"
ExpiresByType application/javascript "access plus 1 month"
# Disable ETags for multi-server setup
# Uncomment the next line if the site is running on multiple servers (cluster or cloud):
#FileETag None
# Internet Explorer enhancements
BrowserMatch MSIE ie
Header set X-UA-Compatible "IE=Edge,chrome=1" env=ie
Header append Vary User-Agent
# Disallow direct access to urltrans, cache and template files
order allow,deny
deny from all
# Error documents
ErrorDocument 401 /message.php?msg=401
ErrorDocument 402 /message.php?msg=402
ErrorDocument 403 /message.php?msg=403
ErrorDocument 404 /message.php?msg=404
ErrorDocument 500 /message.php?msg=500
# URL Rewriting
RewriteEngine On
# Modify the rewritebase to match your Cotonti root path:
RewriteBase /
# Show your site URL with or without 'www' in front? Make a choice.
# Consider this: http://developer.yahoo.com/performance/rules.html#cookie_free
# Make sure to set the root domain in datas/config.php to match your choice,
# otherwise you may not be able to login to your site.
# 1. Append www. to domain if not present. Use this if you're going to use
# a subdomain for static files or need HTTPS:
# RewriteCond %{HTTP_HOST} !^www\.
# RewriteCond %{HTTPS}s ^on(s)|
# RewriteRule ^ http%1://www.%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
# OR:
# 2. Remove www. from domain if present. Use this if you want shorter URLs,
# don't need HTTPS and you're not going to use any subdomains:
# RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
# RewriteRule ^(.*)$ http://%1/$1 [L,R=301]
# Don't rewrite components folders
RewriteRule ^(datas|images|js|lib|themes)/(.*)$ $1/$2 [QSA,NC,NE,L]
# Add custom rewrites here