Fix invalid variable assignment, add more .htaccess optimizations