Magento Homepage Keeps on redirecting to a 404 page
Solution 1
I've got a similar error and would like to post my solution here. The case was exactly the same for me: all the pages, categories, etc. worked perfectly, but the home page showed a 404 error.
I looked into the core_url_rewrite table and discover that there was an entry with the «request_path» field empty. So this entry was rewriting my base url and that was the reason for the 404 in my case. I just deleted it.
Hope this helps to other people.
Solution 2
If you are using the Enterprise version you should check the table enterprise_url_rewrite
. The query below should help you:
select * from enterprise_url_rewrite where request_path="";
delete from enterprise_url_rewrite where request_path="";
Solution 3
Check the folowing:
1- System->Configuration->general->Web->secure Base URL: http://www.your-site.com/ (be sure you are in the right shop site from the top left of the system)
2- System->Configuration->general->Web->Default Pages Default Web URL: cms (yes just cms) CMS Home Page: select your cms page Default No-route URL: cms/index/noRoute
3- check your server has rewrites otherwise System->Configuration->general->Web->Search Engines Optimization Use Web Server Rewrites: No
4- something wrong with your .htaccess replace the file with the one in your original installer.
Solution 4
Because StackOveflow has this stupid rule that I must have a certain number of "points" before I can chime in on discussions I need to make this as a "new answer":
open-ecommerce.org's #2 also solved the problem for me
2- System->Configuration->general->Web->Default Pages Default Web URL: cms (yes just cms) CMS Home Page: select your cms page Default No-route URL: cms/index/noRoute
for me this was set to "index". No clue how it worked before, or why it was set that way, but after updating it broke and this was the fix for me.
Note that I did also truncate the 'core_url_rewrite' table as well in troubleshooting. If you don't change urls at all, or often, then that's no big deal. But if you are chaning URLs often, then you'll loose your 301 redirect history (all old urls will 404 going forward).
Ronic Winmar Concepcion
Updated on June 14, 2022Comments
-
Ronic Winmar Concepcion almost 2 years
I have been on this issue for almost a week now and have been research all over the net for answers but i could not find one.
Problem:
each time i access the homepage of my site, it results to a 404 error.
ex. http://www.domain.com ---> redirects to 404
http://www.domain.com/home ---> enters to the cms page that i set as my homepage
I have already run the magento cleanup scripts but it was not able to solve the problem.
ERROR MESSAGE: Whoops, our bad... The page you requested was not found, and we have a fine guess why. If you typed the URL directly, please make sure the spelling is correct. If you clicked on a link to get here, the link is outdated. What can you do? Have no fear, help is near! There are many ways you can get back on track with Magento Store. Go back to the previous page. Use the search bar at the top of the page to search for your products. Follow these links to get you back on track! Store Home | My Account
-
Alan Storm almost 13 yearsWhich 404? (alanstorm.com/magentos_many_404_pages self-link)
-
Ronic Winmar Concepcion almost 13 yearsThe magento cms page 404. Can be defined in admin. edited the post, added the error message
-
clockworkgeek almost 13 yearsIs the home page enabled for "All Store Views"? You can easily tell from the list of CMS pages.
-
Ronic Winmar Concepcion almost 13 yearsyes it is enabled for all store views
-
Alan Storm almost 13 yearsWhat happened when you ran the debugging steps at the above link?
-
Ronic Winmar Concepcion almost 13 yearswhen i check it on firebut the status is 404 Not Found. i do not have ssh access to the server i cannot run the curl commands
-
Alan Storm almost 13 yearsKeep reading then, there's information that will let you trace the code to figure out why this happening.
-
Ronic Winmar Concepcion almost 13 yearsOk so i found out what the problem is ... Some of the image urls on the site were wrong. Instead of filenames it was a link to where i crawled the images from. After removing that I was able to fix the problem.
-
user487772 almost 13 yearsIt will be cool if you will put this as an answer to your question and will mark it as a correct answer, so others who have same problem will find a solution fast.
-
-
PHP Bugs over 9 yearsOh! Thanks. In my case this was table enterprise_url_rewrite. We are using the Enterprise version. Deleted the entry using the query below: select * from enterprise_url_rewrite where request_path="";
-
M Rostami over 9 yearsAlso check this :
select * from core_url_rewrite where request_path="/";
-
davidanton1d over 3 yearsSame thing worked for me on Magento 2.4, in the table url_rewrite.