Change if statement for url vs file