Quantcast
Channel: Nginx Forum - How to...
Viewing all articles
Browse latest Browse all 4759

Error page for bad folder request

$
0
0
error_page 404 /404.html;

location = /404.html {
root /var/www/;
}

I use the above to catch and direct 404s to a custom 404.html page in /var/www. All my other pages are located in another place. This works fine for catching invalid file request (www.me.net/path1/invalid_file.txt), but doesn't work properly for invalid folder request (www.me.net/invalid_path/). The problem is that I have an image in the custom 404 page and it doesn't show up when erroring on an invalid folder. I guess what I am asking is how do you process bad folder request?

Thanks.

Viewing all articles
Browse latest Browse all 4759

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>