Creating a Custom Error Page (404, 403, 500) in Your Hosting Account
Custom error pages are a great way to enhance your website’s user experience by replacing generic server error messages (like 404 Not Found, 403 Forbidden, or 500 Internal Server Error) with branded, helpful, and visually appealing alternatives.
In this guide, we’ll show you how to create and set up custom error pages using cPanel on your Sternhost account.
🔧 Why Use Custom Error Pages?
-
Keep users engaged even when they hit an error
-
Guide users back to important pages
-
Improve SEO by reducing bounce rates
-
Reinforce your brand’s tone and style
🛠 Step 1: Create Your Custom Error Page(s)
You can use HTML or a content management system (like WordPress) to create your error pages.
Create a separate page for each type of error:
-
404.html
for Page Not Found -
403.html
for Forbidden -
500.html
for Server Error
Add friendly messages, navigation links, and your logo or theme to each page.
🛠 Step 2: Upload Error Pages to Your Site
-
Log in to your Sternhost cPanel.
-
Go to File Manager.
-
Navigate to the root folder of your website (usually
/public_html
). -
Upload your
404.html
,403.html
, and500.html
files.
⚙ Step 3: Configure Custom Error Pages in cPanel
-
In cPanel, go to Advanced > Error Pages.
-
Select the domain you want to configure.
-
Click on the error code you want to customize (e.g., 404, 403, or 500).
-
Choose one of these options:
-
Use the built-in HTML editor
-
Paste custom HTML code
-
Use a redirect to the error page you uploaded (e.g.,
/404.html
)
-
Repeat the steps for each error code.
✅ Bonus: Use .htaccess
for Manual Control
If you’re comfortable with code, you can also use your .htaccess
file:
-
Open File Manager > Show Hidden Files
-
Edit the
.htaccess
file in/public_html
-
Add the lines above
-
Save changes
🔄 Test Your Pages
-
Try visiting a non-existent page to check your 404 page.
-
Attempt to access restricted content for 403.
-
Simulate a 500 error (e.g., with a faulty PHP script) if needed.
Need Help?
Our Sternhost Support Team is available 24/7 if you need help with setup or troubleshooting.
📢 Start Building with Confidence
With Sternhost, you get full control over your hosting environment, advanced tools like cPanel, and the ability to fully brand your website experience—even your error pages.
➡️ Explore our affordable hosting plans at sternhost.com.