I have a website where I need to 301 redirect all old pages that are incoming from old URLs like
/?page_id=2677 and so on to the main home page.
What would be a proper way of doing it? Will something like this in
.htaccess work? I do not want to redirect all 404's - just these type of old links.
RedirectMatch 301 ^/?page_id=4&n=$1 https://www.example.com/