How to set up a 404 Custom Error page on Tengine?
Custom 404 Error Page
aaPanel_Jose oh shit, again I missed it, thanks 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
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
aaP_hotlive501iwin9
Hello, please go to your site to modify the configuration and modify 404.html
aaP_hotlive501iwin9
Hello, do you have 404.html in your directory? Have you restarted nginx?
There are 404.HTML files in the directory
- Edited
aaP_hotlive501iwin9
You have other configuration responses, which you need to investigate by yourself. as rewritten configuration
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
Removing the html extension
example.com/blog.html β-> example.com/blogHaving 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?
aaP_hotlive501iwin9
Hello, is it okay to try adding more parameters?
try_files $uri $uri/ $uri.html $uri.html?$args =404; }