Magento – Magento 2 All Products pages Redirect to catalog search

apachecentoslinuxmagento2PHP

I am facing an issue which is I am not able to access any products pages.
Either trying to access them directly via product URL or product page

Or via Search Results

Or via Site Navigation

every time I try to access a product I get redirected to
a search results page instead of the product page

catalogsearch/result/

for example

http://www.mydomain.co.uk/catalogsearch/result/?q=catalog+product+view+id+28307+s+test-20-june-products

This issue I noticed after I upgraded from Magento 2.2.2 to 2.2.6 But it may have been happening from before until most recently the site and links were working fine.

One other change I made is to remove the .html for categories via the admin settings Admin – Stores – Catalog – Catalog

Search Engine Optimization
Category Url Suffix –

I enabled Flat Catalog:

Use Flat Catalog Category – YES
Use Flat Catalog Product – YES

Create Permanent Redirect for URLs if URL Key Changed – YES

I have run this extension to regenerate new rewrites
https://github.com/olegkoval/magento2-regenerate_url_rewrites

But the same issue is there.

Also, I noted that after the extension has run checking the URL rewrites information in admin it showing redirect type – NO

should this be showing as Permanent?

I have Elastic search and Amasty Elastic search – Amasty Advanced Search extensions installed but the site was working fine previously with this extension – I am not sure if the issue is Upgrade related pro Happened after I made the changes mentioned above

Really appreciate some help with this

Best Answer

We replace our old database now everything working fine, this issue is generated due to url rewrite. You can replace your old database backup and try this.

Related Topic