9

Am struggling with a strange error in magento 2.

Have a setup where i have removed some stores, so now only single store.

Am trying to set the home page in admin (CMS Home Page)

No matter what I do, it says 404 on home page, all other pages work.

Have looked in database, setting for is: web/default/cms_home_page is there and set ok and for scope_id = 0.

not sure which pages it is looking for, is there a way to debug that?

any other suggestions for how to fix this?

  • did you solve this problem? If so, could you tell me how? I am facing the same problem and it driving me nuts. I have tried so many things but as you said: "No matter what I do, it says 404 on home page, all other pages work." Best regards – Ben Dec 13 '18 at 12:46
  • This does not really answer the question. If you have a different question, you can ask it by clicking Ask Question. You can also add a bounty to draw more attention to this question once you have enough reputation. - From Review – Rama Chandran M Dec 13 '18 at 13:07
16

It can happen if one of the products is miss-configured/bad-saved/bad-imported especially url_rewrite table is missing request_path value.

What i did to fix it... Open MySQL console & run this query and see which product(s) has an empty request_path

SELECT * FROM `url_rewrite` WHERE request_path='';

Remove those entities & Clear the cache. Now you can enjoy your homepage ;)

3

In my case,

The categories entity had an empty request_path.

Go to the database and with the help of this command find the categories or products entities that have an empty request_path

SELECT * FROM `url_rewrite` WHERE request_path='';

Delete all those entries and use the cache clean and flush command:

php bin/magento cache:clean
php bin/magento cache:flush

Revisit the url, and the homepage will work fine once again.

0

In admin, go to set the page you want to show as homepage in Stores > Configuration > General > Web > Default Pages > CMS Home Page.

Remember to flush the cache in System > Cache Management > Flush Magento Cache.

  • have tried that, it doesnt work. the setting looks ok in database, but not sure how to debug which page it is looking for. also i can see the page that i choose, if i go it its url. – Nikolai Bendix Jul 29 '16 at 7:05
  • did you get a solution to this problem? – Tisch Apr 12 '17 at 15:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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