How can I use .htaccess to strip/ignore /page/X/ where X is the page number, from my urls, ONLY if it’s right after the domain.com, like domain.com/page/29/ ?
Scraper sites are linking to my site with pagination on posts for some reason, causing Google to crawl those links. Unfortunately my site is not showing a 404, but instead showing a page, and the canonical url is including /page/29/ for example. It’s not good. Hurting my rankings.
How would this be done in htaccess, so that pagination after anything else like a /page-name/ would still work?
You can try the following rule if you want to rewrite /page/X/ to /page/ exactly. (where X is any number)
If you want to rewrite /[anystring]/X/ to /[anystring]/ you can try