Four tools in cPanel control how Apache presents and interprets your site: Error Pages, Indexes, MIME Types and Apache Handlers. Most people never need three of them - but when you do, nothing else will fix the problem. This guide explains what each one does, when it is the right answer, and how to avoid breaking your site with them.
- Error Pages (Advanced) - what visitors see when something goes wrong. Worth doing on every site.
- Indexes (Advanced) - what happens when a folder has no index file. Worth checking once.
- MIME Types (Advanced) - how browsers interpret a file extension. Only for unusual file types.
- Apache Handlers (Advanced) - how the server processes a file extension. Rarely needed; easy to break things.
Error Pages
The default Apache error page is stark, unbranded, and offers a visitor no route back into your site. A custom 404 keeps people who hit a dead link on your site instead of sending them back to search results.
- In cPanel, open Advanced → Error Pages.
- Step 1 - select the domain to manage.
- Step 2 - click one of the common codes, or use Show All HTTP Error Status Codes for the full list. The common ones are:
- 400 Bad request
- 401 Authorization required
- 403 Forbidden
- 404 Not found - by far the most important
- 500 Internal server error
- Enter your HTML in the editor. The buttons above it insert server variables such as the requested URL or the visitor's IP address.
- Click Save.
What makes a good 404 page
- Say plainly that the page was not found, without technical jargon.
- Include your normal site navigation and branding, so it does not look like the site has collapsed.
- Offer a search box and links to your most useful pages.
- Keep it self-contained - if the page relies on assets that are themselves missing, you get an error page that is itself broken.
Note that many applications handle their own error pages. WordPress serves its theme's 404 template, so a cPanel error page will not appear for URLs the application handles - edit the theme instead.
Indexes
When someone requests a folder with no index.html or index.php, Apache may list the folder's contents instead. That "Index of /" page exposes every file in the directory to anyone who guesses the path.
- Open Advanced → Indexes.
- Navigate the directory tree, or click Edit beside the folder you want to change.
- Choose the behaviour:
- Inherit - follow the parent directory's setting. This is the default for every folder.
- No Indexes - return a 403 rather than listing files. The safe choice.
- Show Filename Only - a plain listing.
- Show Filename And Description - a listing with detail.
- Click Save.
public_html to "No Indexes" and let everything below inherit it. Directory listings are how people discover your backup files, upload folders and old copies of the site. Turning them off costs nothing and closes a genuine information leak. Enable listings only on a specific folder where you deliberately want to share files.
MIME Types
A MIME type tells the browser what a file is, so it knows whether to render it, play it or download it. cPanel ships with a very long list of system MIME types covering essentially every common format - which is why most people never touch this tool.
You need it only when you serve an unusual extension the server does not recognise, and the browser downloads it instead of handling it (or the reverse).
- Open Advanced → MIME Types.
- Under Create A MIME Type, enter the type, for example
application/font-woff2. - Enter the extension or extensions, separated by spaces.
- Click Add.
Your entries appear under User Defined MIME Types and can be deleted there. System MIME types cannot be altered, only overridden by adding your own for the same extension.
Apache Handlers
Where a MIME type says what a file is, a handler says how the server should process it before sending. This is the tool that decides that .php files are executed rather than displayed.
Your account already has handlers configured. A typical setup looks like:
| Handler | Extensions | Source |
|---|---|---|
application/x-httpd-ea-php82 |
.php .php8 .phtml | User defined - set by your PHP version |
cgi-script |
.cgi .pl .plx .ppl .perl | System |
server-parsed |
.shtml | System |
To add one: enter the handler name and the extensions, separated by spaces, then click Add. For example, to make .example files run as CGI scripts, use handler cgi-script and extension .example.
Troubleshooting
| Symptom | Cause and fix |
|---|---|
| Browser downloads your PHP file instead of running it | Urgent - the PHP handler is missing or broken, and your source is being served publicly. Set the PHP version again in MultiPHP Manager to rewrite it, and open a ticket if that does not fix it. Treat any credentials in those files as exposed. |
| Custom error page does not appear | Your application handles its own errors. Edit the CMS or framework's error template instead. |
| Error page shows but with no styling | It references stylesheets with relative paths that do not resolve from the failed URL. Use absolute paths, or inline the CSS. |
| "Index of /" still appears after choosing No Indexes | You set it on a different folder, or an .htaccess lower down re-enables Options +Indexes. Check the specific directory. |
| Whole site returns 403 after changing Indexes | No Indexes is set and there is no index file in that folder. Upload an index.html or index.php. |
| A file downloads instead of displaying | Its extension has no MIME type, or the wrong one. Add the correct type in MIME Types. |
| Site broke immediately after adding a handler | Delete the handler you just added. Handlers apply site-wide and take effect at once. |
| Fonts fail to load with a console warning | Usually a CORS issue rather than a MIME type. Check the browser console message before adding a MIME type that will not help. |
Frequently asked questions
Which of these should I actually set up?
A custom 404 page, and No Indexes on public_html. Those two take five minutes and benefit every site. Leave MIME Types and Apache Handlers alone unless you have a specific problem they solve.
Do these settings apply to all my domains?
Error Pages are chosen per domain. Indexes are per directory. MIME Types and Apache Handlers apply to the whole account.
Can I edit these in .htaccess instead?
Yes - these tools write .htaccess directives for you. Using the cPanel interface avoids syntax errors, which in .htaccess mean an immediate 500 error across the site.
Does a custom 404 page help SEO?
Indirectly. It keeps visitors on your site rather than losing them, provided it returns a genuine 404 status rather than redirecting.
Where are my error page files stored?
In the document root as files named after the code, such as 404.shtml. You can edit them in File Manager once created.
I deleted a system handler by mistake.
System handlers cannot be deleted - only user-defined ones can. If PHP has stopped working, reset the version in MultiPHP Manager, and open a ticket if that does not restore it.
