RewriteEngine On
Options -Indexes

<FilesMatch "\.(log|ini|sql|txt)$">
    Order allow,deny
    Deny from all
</FilesMatch>

<FilesMatch "^\.">
    Order allow,deny
    Deny from all
</FilesMatch>

ErrorDocument 403 /403.html
ErrorDocument 404 /404.html

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^ index.php [L]