Totally Zenned
- Join Date:
- Jan 2004
- Location:
- N of San Antonio TX
- Posts:
- 9,904
- Plugin Contributions:
- 23
FYI: When Does Something Extra Cause a 404 Error?
We all fight the dreaded 404 error from time to time. Sometimes you think it's a snipe hunt. We hunt a LOT of snipe here in Texas and a lot of searching for the elusive files reported with a 404 BUT....
We recently picked up a site that had been doing okay for some time but was getting strange ranks and evals. The site seemed to come up well and the parse times were better when moved to our server but, Chrome's inspect console came up with a 404 error when loading. If I had not been watching the console, I wouldn't have seen the error. There were no errors in the log files and the site seemed to be running perfectly. Once you left the home page, the 404 was no longer seen.
Next, the Web Developer Extension was used to run the W3C validator against the site's CSS. W3C informed me that the site could not be found. Never had a 404 for a SITE. But, none of the W3C validators and most online validators could connect to the site. Of course, we checked DNS and it all checked out.
Ran curl test and it did the 301 we set to go to https://WEBSITE.com BUT, it did a 404 on arrival. Reran the curl test with --resolve to no avail.
So the domain was resolving to the server, arriving at the server, 301 done (if needed), and then the 404 showed up. Did another curl test with --resolve to make sure and got the same result.
Next, the Apache LogLevel was increased and the tests rerun. All the way down to line 364 of the log it tells us that index.php is giving us the 404.
Without giving the boring code, the next test said the 404 was coming from```
/home/CUSTOMER/public_html/includes/modules/pages/index/header_php.php
Double, triple, and quadruple checked the files with still no luck in finding a missing file.
Then, we stumbled on a YOUR_TEMPLATE in the includes/languages/english/html_includes/ folder. This should explain it. Obviously, the overrides did not get where they were supposed to be. However, how could an override not being utilized cause a 404?
Further review showed that all the files in the YOUR_TEMPLATE were, in fact, in the site's template file.
The revelation finally came with a scroll of the wheel on the mouse. The includes/languages/english/html_includes/classic folder (that was the template) had an extra file.
Wouldn't have looked in that folder except that was the template being used. Don't know why I scrolled to the bottom.
All the files in that folder start with define.... There are generally many files in the folder even for a override.
BUT, there at the bottom of the list sat header.php.
No telling how far back the includes/languages/english/classic/header.php had been accidentally copied into includes/languages/english/html_includes/classic!!
We had transferred the site and shutdown the old before we discovered the "working but not working" status and the transfer gave us new file dates instead of keeping the old dates.
Didn't know where to put this but, I imagine someone might need this in the future. Maybe it will save you a week of head-scratching.
Need a hand with Zen Cart? Hire the team at myZenCartZone.com for upgrades, repairs, and custom plugins.
Zen Cart Certified hosting at myZenCartHost.com