RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond $1 !^(controllers|resources|core|config|helpers|contents|templates|views)
RewriteRule ^(.*)$ index.php?p=$1 [L]