404 File not found, .htm, .html referenced in error code
-
Possible solution for anyone that’s having this problem. I just migrated a client’s wordpress site from one server to the other (keeping URL the same) and was going through the site testing to make sure everything was functioning okay. At first I found that none of the page links worked and got 404 file not found errors for all of them. I traced this to my permalink settings being wrong and then back to the mod-rewrite engine not being enabled. Once I got that fixed most of the pages worked, but I still got a few pages that were giving me 404 file not found errors. I was able to log into the wordpress dashboard and verify the URLs, but was not able to view the pages. I would always get a 404 file not found error. Permalink settings were working, everything seemed good, but for some reason these specific pages were not working. I then noticed that in the 404 file not found error code, where the error lists the URL I attempted to reach that in fact the URL wasn’t correct. For example, I wanted to reach mysite.com/contact/, yet the error code was telling me that mysite.com/contact.htm could not be found. Notice the .htm at the end of the URL. Why would it do that? It turns out that I had a file on the server in the root directory that was named contact.htm. Deleting that file fixed the issue. WordPress doesn’t like when you have htm or html files that have the same name as page files that link to similarly names URLs like mysite.com/contact/ and mysite.com/contact.htm. Gotta get rid of the htm and html files of similar/same names. Hope that helps someone out there!
- The topic ‘404 File not found, .htm, .html referenced in error code’ is closed to new replies.