RewriteEngine on

# Uncomment the below and change the rewrite base if site is at different URL.
# RewriteBase /

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

RewriteCond %{REQUEST_FILENAME} !-l
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

RewriteRule ^(.*)$ index.php [QSA,L]

<Files *.php>
    Deny from all
</Files>

<Files index.php>
    Order Allow,Deny
    Allow from all
</Files>
