SetEnvIf Host .*.dev APPLICATION_ENV=dev
<If "req('Host') =~ /.*.dev$/">
php_value xdebug.var_display_max_children 512
php_value xdebug.var_display_max_data 1024
php_value xdebug.var_display_max_depth 10
</If>
# Disable cookies for static subdomain and allow Cross-Origin resouce sharing
<IfModule mod_headers.c>
Header add Access-Control-Allow-Origin "*"
Header add Access-Control-Allow-Headers "Origin, X-Requested-With, Content-Type"
Header add Access-Control-Allow-Methods "GET"
SetEnvIf Host static..* IS_STATIC_DOMAIN
Header unset Cookie env=IS_STATIC_DOMAIN
Header unset Set-Cookie env=IS_STATIC_DOMAIN
</IfModule>
Options -Indexes -MultiViews
# Set all error pages to rewriteless entry point
ErrorDocument 403 /index.php
ErrorDocument 404 /index.php
ErrorDocument 500 /index.php
<IfModule mod_expires.c>
# Enable expirations
ExpiresActive On
# Default directive
ExpiresDefault "access plus 1 week"
# Favicon
ExpiresByType image/x-icon "access plus 1 month"
# Images
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"
# CSS
ExpiresByType text/css "access 1 month"
# Javascript
ExpiresByType application/javascript "access plus 1 month"
</IfModule>
<IfModule mod_rewrite.c>
# Enable rewrites
RewriteEngine On
# Change default entry point
DirectoryIndex application.php
# Static domain should link to existing files otherwise
RewriteCond %{HTTP_HOST} ^static..*$
RewriteCond %{REQUEST_URI} !favicon.ico$
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-l
RewriteRule ^(.*)$ "-" [F,L]
# Protect application with redeirect to invalid route
RewriteCond %{REQUEST_URI} !.html$
RewriteRule ^wh_application/?(.*)$ /wh_application/$1.html [R,L]
# Redirect favicon.ico to PHP script
RewriteCond %{REQUEST_URI} favicon.ico$
RewriteRule ^(.*)$ favicon.php [NC,L]
# Fix routes with adding trailing slash
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-l
RewriteCond %{REQUEST_URI} !.[a-z0-9]{2,4}$
RewriteCond %{REQUEST_URI} !(.+)/$
RewriteRule ^(.+)$ /$1/ [L,R=301]
# Redirect all other request to entry point
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ application.php [NC,L]
</IfModule>