Apache handlers tell the web server itself how to handle certain types of files. You can define what the server does with certain types of files by clicking Apache Handlers in cPanel. There are a couple of handlers already installed.
One potential use for this feature is to be able to create files that contain both HTML code and PHP code, and have both be parsed properly by Apache. Normally, if you want the code to be parsed properly you can only have PHP code in files that end in .php, .php4
, or .php3
. If you place PHP code in an .html
file, the code will be displayed on screen as text. If you need to have both types of code in a single file, you need to tell Apache that it needs to expect PHP code in .html
or .htm
files. To do this, add the line Extensions: .html .htm Handler: application/x‑httpd‑php. From now on, Apache will parse PHP code if it is found inside .html
or .htm
files.