# Don't show directory directory listings.
Options -Indexes

# Route requests to Exponent.
DirectoryIndex index.php

# Various rewrite rules.
<IfModule mod_rewrite.c>
    RewriteEngine On

# you may have to edit/uncomment the next line if working from a subfolder
#    RewriteBase /subfolder-name

   # To redirect all users to access the site WITH the 'www.' prefix,
    # (http://example.com/... will be redirected to http://www.example.com/...)
    # adapt and uncomment the following:
    # RewriteCond %{HTTP_HOST} ^example\.com$ [NC]
    # RewriteRule ^(.*)$ http://www.example.com/$1 [L,R=301]
    #
    # To redirect all users to access the site WITHOUT the 'www.' prefix,
    # (http://www.example.com/... will be redirected to http://example.com/...)
    # uncomment and adapt the following:
    # RewriteCond %{HTTP_HOST} ^www\.example\.com$ [NC]
    # RewriteRule ^(.*)$ http://example.com/$1 [L,R=301] 
  
    RewriteRule ^$ index.html [QSA]
    RewriteRule ^([^.]+)$ $1.html [QSA]

    # Kludge out certain file types that we don't want to try to route thru the eXp router.
    RewriteCond $1 !^(.*\.css|.*\.js|.*\.png|.*\.pdf|.*favicon\.ico|robots\.txt|.*\.shtml|.*\.htc) [NC]

    # Kludge out image files that we don't want to try to route thru the eXp router.
    RewriteCond $1 !^(.*\.jpg|.*\.gif|.*\.png|.*\.jpeg|.*\.tiff|.*\.bmp) [NC]
    
    # These rules 
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ index.php [QSA,L]

    # RewriteRule ^login.php$ login/showlogin

</IfModule>

ErrorDocument 403 /index.php?controller=notfound&action=handle_not_authorized&error=403
ErrorDocument 404 /index.php?controller=notfound&action=handle&error=404
ErrorDocument 500 /index.php?controller=notfound&action=handle_internal_error&error=500
