HOW TO Custom Errors Message in web.config, I met a BIG PROBLEM

I wanna custom the error messages,like 404 Page.
This is my web.config file. I created it in WWWROOT. But it didn’t work, Help! I have already read many docs, but I still can not solve the problem… HELP ME… THANK U
code:

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.web>
<customErrors defaultRedirect="~/err/404.html" mode="on">
<error statusCode="403" redirect="~/err/403.html" />
<error statusCode="404" redirect="~/err/404.html" />
</customErrors>
</system.web>
</configuration>