edit index.php and added compatibility for nested public directory