0

Apache 2.4 on Windows 11, thus localhost.

I'm running a Wordpress site and Apache serves all URLs correctly except for one. One URL 404s. The Apache error log contains this error:

AH00687: Negotiation: discovered file(s) matching request: C:/wwwroot/site/the-page; (None could be negotiated)., referer: http://localhost:8090/

How is it possible that Apache can serve all the other PHP pages (Wordpress pages, not posts) and not this one?

What do I need to do to fix this?

The page works in production. I restored the Wordpress database to the localhost in case I had a corruption issue with my local copy, but the problem persists.

Also note, that for all other 404 errors, Apache serves my custom 404 page. For the problem url, it only serves a generic 404 message.

This URL worked as recently as two weeks ago, and restoring the .htaccess file did not fix the problem.

Karl
  • 99
  • 1
  • 3
  • I think we are missing context here, please show a "curl" example of the actual request, the appropiate configuration you have in httpd (multiviews?) the access log, error log of the entry of the test , etc. – Daniel Ferradal Mar 31 '23 at 13:55
  • @DanielFerradal how do I show a curl example? This is from the access.log: `::1 - - [31/Mar/2023:06:01:46 -0400] "GET /retirement-calculator HTTP/1.1" 404 196` – Karl Apr 04 '23 at 20:02

1 Answers1

0

After all this time, the issue turned out to be a problem with a random file located in the root of the WordPress project. Specifically:

/wwwroot/<project>/wp-content/themes/<theme>/page-my-page-file.php
/wwwroot/<project>/my-page-file.de.txt

In other words:

WordPress template pages follow this convention: "page-*.php" and are located in the theme's root.

If a file with the same name as the template file but without the initial "page-" exists in in the root of the project, then Apache/WordPress will not serve the web page.

Perhaps this will save someone some time.

Karl
  • 99
  • 1
  • 3