Setting up Custom Error Pages - Apache .htaccess Guide & Tutorial

Опубликовано: 29 Сентябрь 2024
на канале: myPHPnotes
4,527
29

Normally, apache provides their own rusty error pages to indicate server errors.
But these error pages are customizable to increase user interaction.
In this video, we will go through how can you set up error pages for server errors.


BEWARE
These error pages will only work for servers generated errors, not for scripts like PHP generated server errors.

ERROR CODES:

2xx Success Error Code List
=======================
200 – OK
201 – Created
202 – Accepted
203 – Non-Authoritative Information (since HTTP/1.1)
204 – No Content
205 – Reset Content
206 – Partial Content (RFC 7233)
207 – Multi-Status (WebDAV; RFC 4918)
208 – Already Reported (WebDAV; RFC 5842)
226 – IM Used (RFC 3229)


3xx Redirection Error Code List
=========================
300 – Multiple Choices
301 – Moved Permanently
302 – Found
303 – Check Other (since HTTP/1.1)
304 – Not Modified (RFC 7232)
305 – Use Proxy (since HTTP/1.1)
306 – Switch Proxy
307 – Temporary Redirect (since HTTP/1.1)
308 – Permanent Redirect (RFC 7538)

4xx Client Error Code List
=====================
400 – Bad Request
401 – Unauthorised (RFC 7235)
402 – Payment Required
403 – Forbidden
404 – Not Found
405 – Method Not Allowed
406 – Not Acceptable
407 – Proxy Authentication Required (RFC 7235)
408 – Request Timeout
409 – Conflict
410 – Gone
411 – Length Required
412 – Precondition Failed (RFC 7232)
413 – Payload Too Large (RFC 7231)
414 – URI Too Long (RFC 7231)
415 – Unsupported Media Type
416 – Range Not Satisfiable (RFC 7233)
417 – Expectation Failed
418 – I’m a teapot (RFC 2324)
421 – Misdirected Request (RFC 7540)
422 – Unprocessable Entity (WebDAV; RFC 4918)
423 – Locked (WebDAV; RFC 4918)
424 – Failed Dependency (WebDAV; RFC 4918)
426 – Upgrade Required
428 – Precondition Required (RFC 6585)
429 – Too Many Requests (RFC 6585)
431 – Request Header Fields Too Large (RFC 6585)
451 – Unavailable For Legal Reasons

5xx Server Error Code List
======================
500 – Internal Server Error
501 – Not Implemented
502 – Bad Gateway
503 – Service Unavailable
504 – Gateway Timeout
505 – HTTP Version Not Supported
506 – Variant Also Negotiates (RFC 2295)
507 – Insufficient Storage (WebDAV; RFC 4918)
508 – Loop Detected (WebDAV; RFC 5842)
510 – Not Extended (RFC 2774)
511 – Network Authentication Required (RFC 6585)





Request a Video Tutorial here:
https://www.youtube.com/myPHPnotes/di...

Want Source Code?
Comment Below.

Learn about Composer:
   • Composer Explained  

Learn about Virtual Hosts:
   • Virtual Hosts Explained  


Brought to you by
www.myphpnotes.tk