Mod rewrite rules and change file permissions