3 years later

I have multiple domains, what if I just want to set for specific domain to redirect to a custom 404?
For example :
abc66.com/error β€”-> abc66.com/404
bca88.com/error β€”-> bca88.com/404

aaPanel_Jose

I have multiple domains, what if I just want to set for specific domain to redirect to a custom 404?
For example :
abc66.com/error β€”-> abc66.com/404
bca88.com/error β€”-> bca88.com/404

    aaPanel_Kern
    Β·Β·Β·
    location / {
    if ($request_uri ~ ^/(.*).html$)
    { return 302 /$1; }
    try_files $uri $uri/ $uri.html $uri.html?$args; }
    Β·Β·Β·
    ...
    error_page 404 /404.html;
    ...

    I've found the issue,

    I was going to have 2 conditions, but they seems to have issue when putting both together

    1. Removing the html extension
      example.com/blog.html β€”-> example.com/blog

    2. Having redirect to error 404 page
      example.com/abx is not a valid page
      It will redirected to 404 page

    Do you have any method which can make both works at the same time?