You have to fine tune the regular expression (i.e. "\\.(html|php)$") to fit your specific application.
Regular Expressions are common to many programming languages and not specific to R, if you are going to be cleaning text often, you might benefit from learning about them.
library(tidyverse)
sample_df <- data.frame(
URL = c("football.html", "Athletics.php")
)
sample_df %>%
mutate(games = str_remove(URL, "\\.(html|php)$"))
#> URL games
#> 1 football.html football
#> 2 Athletics.php Athletics
Created on 2021-05-18 by the reprex package (v2.0.0)