title: how to redirect to my custom 404 error page if subdirectory not present
body: <p>I have joomla site and I have custom 404 error page.
  Which works correctly if there is no file present.
  ex: <code>my-domain.com/aaa</code>
  then it shows custom 404 page correctly with URL: <code>my-domain.com/error-404.html</code></p>
  
  <p>But when sub-directory is not present (ex: <code>my-domain.com/aaa/</code>) then it not shows it properly as URL changes to my-domain.com/aaa/error-404.html</p>
  
  <p>I want to redirect to my 404 error page if sub-directory name typed is not present.</p>