# JaguarEngine
# @version 0.0.1a
# @author Michael Snoeren
# @license http://michaelsnoeren.nl/license/
# Turn on the engine
RewriteEngine on
# Block out any script trying to base64_encode data within the URL.
RewriteCond %{QUERY_STRING} base64_encode[^(]*([^)]*) [OR]
# Block out any script that includes a <script> tag in URL.
RewriteCond %{QUERY_STRING} (<|%3C)([^s]*s)+cript.*(>|%3E) [NC,OR]
# Block out any script trying to set a PHP GLOBALS variable via URL.
RewriteCond %{QUERY_STRING} GLOBALS(=|[|%[0-9A-Z]{0,2}) [OR]
# Block out any script trying to modify a _REQUEST variable via URL.
RewriteCond %{QUERY_STRING} _REQUEST(=|[|%[0-9A-Z]{0,2})
# Return 403 Forbidden header and show the content of the root homepage
RewriteRule .* index.php [F]
# Set caching headers
<filesMatch ".(ico|gif|jpg|png|jpeg)$">
ExpiresActive On
ExpiresDefault "access plus 1 day"
Header append Cache-Control "public"
</filesMatch>
<filesMatch ".(js|css)$">
ExpiresActive On
ExpiresDefault "access plus 1 day"
Header append Cache-Control "public"
Header append Cache-Control "must-revalidate"
</filesMatch>
# Do not listen to folders!
#RewriteCond %{REQUEST_FILENAME} !-d
# Listen to files
RewriteCond %{REQUEST_FILENAME} !-f
# Redirect all to the index
RewriteRule . index.php [L]