added index.php removal and environment override function