<IfModule mod_deflate.c>
# Compress HTML, CSS, JavaScript, Text, XML and fonts
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE application/rss+xml
AddOutputFilterByType DEFLATE application/vnd.ms-fontobject
AddOutputFilterByType DEFLATE application/x-font
AddOutputFilterByType DEFLATE application/x-font-opentype
AddOutputFilterByType DEFLATE application/x-font-otf
AddOutputFilterByType DEFLATE application/x-font-truetype
AddOutputFilterByType DEFLATE application/x-font-ttf
AddOutputFilterByType DEFLATE application/x-javascript
AddOutputFilterByType DEFLATE application/xhtml+xml
AddOutputFilterByType DEFLATE application/xml
AddOutputFilterByType DEFLATE font/opentype
AddOutputFilterByType DEFLATE font/otf
AddOutputFilterByType DEFLATE font/ttf
AddOutputFilterByType DEFLATE image/svg+xml
AddOutputFilterByType DEFLATE image/x-icon
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE text/javascript
AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE text/xml

# Remove browser bugs (only needed for really old browsers)
BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4\.0[678] no-gzip
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
Header append Vary User-Agent
</IfModule>
<IfModule mod_expires.c>
# Enable expirations
ExpiresActive On 
# Default directive
ExpiresDefault "access plus 1 month"
# My favicon
ExpiresByType image/x-icon "access plus 1 year"
# 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 plus 1 month"
# Javascript 
ExpiresByType application/javascript "access plus 1 month"
</IfModule>

<IfModule mod_rewrite.c>
RewriteEngine On
Options -Indexes

# allow /<any>/<param> redirect to /1ticks/event/<param>
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !^.*/web/.*$
RewriteRule ^(.+)/(.+)$ ./ticktactoe/staging/1ticks/event/$2 [NC,L]

# force https
#RewriteCond %{HTTPS} off
#RewriteCond %{HTTP:X-Forwarded-Proto} =http
#RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]

# force www
#RewriteCond %{HTTP_HOST} ^www\. [NC] 
#RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]

RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . ticktactoe/staging/index.php [L]
</IfModule>
<IfModule mod_headers.c>
Header set X-XSS-Protection "1; mode=block"
Header set X-Content-Type-Options nosniff

Header set Content-Security-Policy "frame-ancestors https://deborahnroy.1ticks.com/ https://mycart.ai/ https://event.mycart.ai/ https://lisboeta.eventmacau.com/ https://mgm.eventmacau.com/ 'self';"
# For IE 11 and below
Header append X-Frame-Options SAMEORIGIN
Header append X-Frame-Options "ALLOW-FROM https://mycart.ai/ https://lisboeta.eventmacau.com/ https://mgm.eventmacau.com/"

Header set Strict-Transport-Security "max-age=31536000; includeSubDomains; preload"
Header unset X-Powered-By
Header unset Server
</IfModule>