0

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

5
  • Can no one offer any suggestions atleast! really stuck on this please help
    – jt9489
    Commented Aug 21, 2019 at 10:51
  • I know it may be not a helpful comment, but I have just flushed the cache and product page is loaded normally Commented Jan 20, 2020 at 15:45
  • @jt9489, How did you resolve this issue?
    – MagentoDev
    Commented Jan 31, 2020 at 10:01
  • Same issue happen for me also Commented Feb 4, 2020 at 4:57
  • Any update on this issue? Commented Feb 12, 2020 at 8:50

3 Answers 3

0

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.

0

Few things that you can do:

  1. Make sure that the product is enabled on the Store View level.
  2. To regenerate the URL, try removing the product from the Website, then add it again. In Magento admin product page, under Product in Websites, try unchecking the website, the save. Check URL rewrites, the product URL rewrites should be removed. Add to the website again, new URL rewrites will be added.
0

I also got the same issue.

And no solution worked for me.

At last i come with a solution that worked for me

In catalog listing page or catalog search page.

I made URL looks like below

https://sitedomain.com/catalog/product/view/id/your_product_id/s/your_product_url_key

My actual code looks something like this:

<a class="product-item-link"
                           href="<?php /* @escapeNotVerified */ echo $block->getBaseUrl()."catalog/product/view/id/".$_product->getId()."/s/".$_product->getUrlKey(); ?>">
                            <?php /* @escapeNotVerified */ echo $_helper->productAttribute($_product, $_product->getName(), 'name'); ?>
                        </a>

And it works for me

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.