IIS:PHP - 我的html网站中的每个目录可以有不同的404页面吗?

I am creating an HTML website which has many sub directories. I want to have different 404 page for each directory.

Basically what I am trying to do is to, create a index.php file in each directory and treat that as 404 page. This page will request the url and check the requested file name and return the content accordingly.

Or you could just make an .htaccess file with:

ErrorDocument 404 404.html

Note there is no backslash before the 404.html - so now it will always look in the current directory for the error page.