<VirtualHost *>
  DocumentRoot  /data/html/users/dado/playground/app/www
  ServerName    playground.web
  ServerAlias *.playground.web
  ErrorLog     /data/html/users/dado/playground/app/var/log/error_log

  <Directory /data/html/users/dado/playground/app/www>
    # this is equivalent to .htaccess inside the app/www/.htaccess
    # it can be copy-pasted verbatim

    # some sane defaults
    DirectoryIndex index.php index.html
    AddDefaultCharset UTF-8
    SetEnv APPLICATION_ENV 'testing'

    # force IE to use the latest available rendering engine
    <IfModule mod_setenvif.c>
      BrowserMatch MSIE ie
      Header set X-UA-Compatible "IE=Edge,chrome=1" env=ie
    </IfModule>

    # mod_php5 on Suse, mod_php on almost anything else
    <IfModule mod_php5.c>
    # <IfModule mod_php.c>
      php_flag magic_quotes_gpc 0
    </IfModule>

    <IfModule mod_rewrite.c>
      RewriteEngine On

      ## redirect all non-www.domain.com requests to www.domain.com, saving request
      # HTTP
      RewriteCond %{HTTPS} off
      RewriteCond %{HTTP_HOST} !^www\.(.*)$ [NC]
      RewriteCond %{HTTP_HOST} ^(.*)$ [NC]
      RewriteRule ^(.*)$ http://www.%1/$1 [R=301,L,QSA]
      # HTTPS
      RewriteCond %{HTTPS} on
      RewriteCond %{HTTP_HOST} !^www\.(.*)$ [NC]
      RewriteCond %{HTTP_HOST} ^(.*)$ [NC]
      RewriteRule ^(.*)$ https://www.%1/$1 [R=301,L,QSA]

      ## enforce trailing slashes on all URLs
      RewriteCond %{REQUEST_FILENAME} !-f
      RewriteCond %{REQUEST_URI} !(.*)/$
      RewriteRule ^(.*)$ /$1/ [L,R=301]

      ## redirect all requests not matching an existing filename to index.php
      RewriteCond %{REQUEST_FILENAME} !-f
      RewriteRule ^(.*)$ index.php [QSA,L]
    </IfModule>

    <ifModule mod_expires.c>
      ExpiresActive On
      ExpiresDefault "access plus 1 seconds"
      ExpiresByType text/html "access plus 1 seconds"
      ExpiresByType image/gif "access plus 1 year"
      ExpiresByType image/jpeg "access plus 1 year"
      ExpiresByType image/png "access plus 1 year"
      ExpiresByType image/x-icon "access plus 1 year"
      ExpiresByType text/css "access plus 1 year"
      ExpiresByType text/javascript "access plus 1 year"
      ExpiresByType application/x-javascript "access plus 1 year"
      ExpiresByType application/javascript "access plus 1 year"
      ExpiresByType application/x-shockwave-flash "access plus 1 year"
    </ifModule>

    <IfModule mod_deflate.c>
      AddOutputFilterByType DEFLATE text/xhtml text/html text/plain text/xml text/javascript application/x-javascript application/javascript text/css
    </IfModule>

    <ifModule mod_headers.c>
      Header unset ETag
    </ifModule>

    # .htaccess equivalent end!
  </Directory>
</VirtualHost>