i've an issue on magento 2.2.5. I've created two store view it/en, when I'm on product page and change store view from it to en and vice versa, I'm redirected to the home page. Someone can help me? Thanks.
There are several bug reports about this in https://github.com/magento/magento2
It seems problem is not fixed yet, even in 2.3.X, but there are some fix proposals if you browse open issues... Main problem is, in 2.2.5 CE version, the Model Magento/UrlRewrite/Model/StoreSwitcher/RewriteUrl.php does not exist
Upgrading to 2.2.6 CE, so we get that model file, and patching it with this https://github.com/magento/magento2/pull/20093/commits/856a80f827329930f37fcf05d50edf9f47c2855e fixed the issue