I am getting 404 errors in Google Search Console for URLs like the following:
http://www.example.com/newsite12121212121212/eg/st_tour/perma/
http://www.example.com/newsite12121212121212/eg/st_activity/extreme-biking/
http://www.example.com/newsite12121212121212/eg/st_activity/extreme-biking/?currency=EUR
http://www.example.com/newsite12121212121212/eg/st_rental/new/?currency=EUR
http://www.example.com/eg-login/?location_id=1680&s=France¤cy=ALL&orderby=price_desc
I want to redirect all of these to the home page of my site as the pages do not exist.
Problem # 1: I want to redirect any page that is under /newsite12121212121212/ (including any subdirectory) to the home page.
Problem # 2: ?currency= some thing, take it back to home page. I tried
RewriteEngine On
RewriteCond %{QUERY_STRING} ^currency=$
RewriteRule ^$ https://www.example.com/? [R=301,L]
It's working for the http://www.example.com?currency=EUR URL but fails on http://www.example.com/eg-login/?currency=EUR.