WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am using Nginx on Ubuntu to host a Wordpress site and everything is working great except certain file types return the Nginx 404 rather than the Wordpress template 404.

For example: http://www.sbbic.org/something.zip shows the Nginx 404 page.

While http://www.sbbic.org/2014/06/17/free-english-khmer-dictionary-mac-osx-download2 shows the template 404 page.

What am I missing in my configuration of Nginx?

share|improve this question
up vote 0 down vote accepted

I received a response with code that fixed the issue from rtcamp.com

Add this code to the nginx site configuration for the domain has the issue with not all 404 requests being handled by Wordpress:

if (!-e $request_filename) {
        rewrite ^/(.+)$ /index.php?q=$1 last;
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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