0

I am having a strange issue with my product filter (layered navigation) not working, I have narrowed this down to the URL paramaters being lost because of a 301 redirect.

If I go to the URL... http://domain.local/styles/?attribute_style=258

I would expect to land on a category page with a result filtered by attribute style. This does't happen, the products aren't being filtered. This seems to be because the above URL goes to a 301 redirect and forwards me to the URL... http://domain.local/styles/ without the query string. 301 Redirect I am pretty sure this is related to a configuration setting as I'm sure it was fine before I imported a pre-existing database.

Does anyone have any idea what is causing this and how I can resolve it?

2
  • can you check your .htaccess file? I guess the reason can be found there. Maybe a rewrite that expects a "/" at the end of the URL, and removes the query params? Replace the .htaccess by the Magento default file to test this. Commented Oct 17, 2019 at 15:42
  • I have replaced the .htaccess with the .htaccess.sample that comes with Magento but it is still doing the 301 redirect.
    – NetStorm
    Commented Oct 18, 2019 at 8:38

2 Answers 2

1

Besides clearing your rewriter table I guess you should clear your browser cache.

1
  • Yes browser cache is a good idea. Or have Dev-Tools open and check "Disable cache" in the network tab. Or simply do http://domain.local/styles/?attribute_style=258 for a request that won't be cached at all. Commented Oct 18, 2019 at 9:43
0

This happened to be a combination between having the trailing slash enabled and a core Magento bug.

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.