RewriteEngine On

# Block access to CMS .htm and .json files and working folders
RewriteRule (^|.*/)pages/.*\.(htm|json)$ - [F,L]
RewriteRule ^.*/?(scrap-cache|scrap-logs)(/|$) - [F,L]

# Route everything else that is not a real file or directory,
# and all managed file types, to the PHP CMS
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d [OR]
RewriteCond %{REQUEST_URI} \.(pdf|zip)$ [NC]
RewriteRule ^(.*)$ index.php?p=$1 [QSA,L]
