Fixed the check for .php when including headers and footers in the routers.