Prerequisites
Before setting up custom error pages, make sure you have:
- SSH access to your VPS
- HTML/CSS knowledge for custom page design
Method 1: Using HestiaCP Web Interface
Step 1: Log in to HestiaCP
https://YOUR_SERVER_IP:8083
Step 2: Navigate to WEB Section
Click on WEB in the top menu bar.
Step 3: Edit Domain
Click the gear icon (⚙️) next to your domain.
Step 4: Go to Error Pages Tab
Click on Error Pages tab.
Step 5: Customize Error Pages
For each error code (404, 500, 403, etc.), you can:
- Upload custom HTML file
- Edit the default template
Step 6: Save
Click Save to apply.
Method 2: Manual Error Page Setup (Nginx)
Create error page files:
nano /home/admin/web/example.com/public_html/404.html
nano /home/admin/web/example.com/public_html/500.html
nano /home/admin/web/example.com/public_html/403.html
Edit Nginx config:
nano /home/admin/conf/web/nginx.example.com.conf
Add inside server block:
error_page 404 /404.html;
error_page 500 502 503 504 /500.html;
error_page 403 /403.html;
location = /404.html {
root /home/admin/web/example.com/public_html;
internal;
}
location = /500.html {
root /home/admin/web/example.com/public_html;
internal;
}
Restart Nginx:
systemctl restart nginx
Method 3: Manual Error Page Setup (Apache)
Edit .htaccess or Apache config:
nano /home/admin/web/example.com/public_html/.htaccess
Add:
ErrorDocument 404 /404.html
ErrorDocument 500 /500.html
ErrorDocument 403 /403.html
Sample Custom 404 Page
<!DOCTYPE html>
<html>
<head>
<title>Page Not Found</title>
<style>
body { font-family: Arial; text-align: center; padding: 50px; }
h1 { font-size: 72px; margin: 0; color: #b0b0b0; }
p { font-size: 20px; }
a { color: #008BDB; text-decoration: none; }
</style>
</head>
<body>
<h1>404</h1>
<h2>Page Not Found</h2>
<p>The page you are looking for does not exist.</p>
<p><a href="/">« Back to Home</a></p>
</body>
</html>
Test Error Pages
Test 404:
curl -I https://example.com/nonexistent-page
Should return 404 and serve your custom page.
✅ Custom error pages have been configured!