Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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

1 Answer 1

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

 
discard

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.