Updated the way the .php extension is removed.