Set default cache expire to 24 hours
Better handling of errors

- added rewrite rules for blocking direct access to content and system
files
- new error function to handle errors