Strange situation in Google index. We're running Magento with two store-fronts on different domains. Somehow Google index is displaying some pages from one store as belonging to the correct store but also the other. So for example:
Visiting the incorrectly indexed URL gives a 404 as expected. Fetch as Google also correctly shows it not available (these appear in the crawl error report). However, looking at the cached copy shows the page from the other store. The cached copy has the correct URL and the cached canonical tag is correct. The incorrect page has never been in the just-printing sitemap or linked anywhere because it's an invalid URL that would (should!) always have given a 404.
Does anyone have a clue how this could have come about?
We can remove these invalid URLs but I'm trying to understand how this has happened. We switched the just-printing site to HTTPS in the last 10 days, but it would appear these incorrect URLs have been in the index since at least the start of 2017.
The only thing I can think of is that at some point Magento served the alocaprinter page to GoogleBot, but with a just-printing canonical link - which would be a worry given Magento auto-generates most of the canonicals!
P.S. I've read through similar questions/answers but none seem to address this issue.