# Set the default handler
DirectoryIndex router.php?page=home index.php index.html

ErrorDocument 404 /404.php

RewriteEngine On
Options +FollowSymLinks -MultiViews

RewriteBase /

# remove trailing slashes
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)/$ /$1 [L,R]

RewriteRule ^voteslager.html$ gallery [L,R]
RewriteRule ^store-locator.html$ #contact [L,R,NE]
RewriteRule ^contact-us.html$ #contact [L,R,NE]
RewriteRule ^wholesale-customers.html$ / [L,R]


RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([a-z\-0-9]+)/preview$ router.php?page=$1&v=0 [L,R]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([0-9]+)/([0-9]+)$ router.php?id=$1&v=$2 [L]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^\/]*)$ router.php?page=$1