# Prevent viewing of .htaccess file
<Files .htaccess>
order allow,deny
deny from all
</Files>

# Prevent directory browsing
IndexIgnore */*

# Set the default handler
DirectoryIndex index.php

RewriteRule ^(archive|comment|coming-soon|rss-feed).html$ index.php?cmd=$1
RewriteRule ^index.html$ index.php
RewriteRule ^coming-soon/(.*)/index.html index.php?cmd=coming-soon&page=$1 [nc]
RewriteRule ^search/(.*)/(.*)/(.*)/index.html index.php?cmd=search&search=1&keywords=$1&archive=$2&page=$3 [nc]
RewriteRule ^event/(.*)/(.*)/(.*)/index.html index.php?cmd=event&event=$1&page=$2 [nc]
RewriteRule ^event/(.*)/(.*)/index.html index.php?cmd=event&event=$1 [nc]
RewriteRule ^contact/(.*)/(.*)/index.html index.php?cmd=contact&event=$1 [nc]
RewriteRule ^comment/(.*)/(.*)/index.html index.php?cmd=leave-comment&event=$1 [nc]
RewriteRule ^view-picture/(.*)/(.*)/index.html index.php?cmd=view-picture&picture=$1 [nc]
RewriteRule ^home/(.*)/(.*)/index.html index.php?cmd=home&month=$1&year=$2 [nc]
RewriteRule ^archive/(.*)/(.*)/index.html index.php?cmd=archive&month=$1&year=$2 [nc]

# URL rewrite rules
<IfModule mod_rewrite.c>
   RewriteEngine On
   RewriteCond %{REQUEST_FILENAME} !-f
   RewriteCond %{REQUEST_FILENAME} !-d
   RewriteCond %{REQUEST_FILENAME} !-l
   RewriteRule ^(.*)$ index.php [QSA,L]
</IfModule>
