How do i use .htaccess to strip/ignore /page/X/ where X may be the page number, from the web addresses, Only when it's immediately after the, like ?

Scraper sites are connecting to my website with pagination on posts for whatever reason, leading to Google to crawl individuals links. Regrettably my website isn't showing a 404, but rather showing a webpage, and also the canonical url is including /page/29/ for instance. It isn't good. Harming my ratings.

Wouldso would this be completed in htaccess, to ensure that pagination after other things just like a /page-title/ would still work?

You can test the next rule if you wish to rewrite /page/X/ to /page/ exactly. (where X is a variety)

RewriteRule ^page/([0-9]+)/$ [R=302,L]

If you wish to rewrite /[anystring]/X/ to /[anystring]/ you can test

RewriteRule ^(.*)/([0-9]+)/$$1/ [R=302,L]