Still both the methods does not work. First method is not dynamic with url. The error page (404) can occur from any parts of the url (eg, domainname/subdir/anything, domainname/subdir/anotherdir/anything, domainname/anything)
Second method still does not work, I have done as stated and please see the pics below if I have done anything wrong.
Error (404) page in root level
Linked page(404) in sub directory and setting the alias path