Archive for the tag 'Handlers'

SBDavid

Apache Handlers, running html as php

Apache Handlers, running html as php

Apache handlers allow you to control what Apache will do with certain file types. When Apache sees a file, it has an action built in for that file type, and will perform that action.

If you wish Apache to do a different action, you will need to make a handler to tell Apache to perform that action. For example, if you use a file type that requires a special service to run it, such as a file with server side includes that is not named with a .shtml extension, you need to tell Apache to treat these files differently.

To get regular html pages to handle php code, you need to add this line to your htaccess file.

AddHandler application/x-httpd-php5 .html .htm

It is highly recommended that you never allow html pages to automatically handle php or shtml, because this forces all of your html pages to be processed by the server first. Instead, please rename your files to .php or .shtml whenever possible.

Apache Handlers For cPanel version 11.30

Apache handlers control how your site’s Apache web server software manages certain file types and file extensions.

Apache comes configured to handle CGI scripts and server-parsed files. Their file extensions include: .cgi, .pl, .plx, .ppl, .perl, and .shtml.

You can configure Apache to handle a new file type with an existing handler by manually adding the handler and extension to cPanel.

For example, to have the server treat files with the extension .example as CGI files, you would type ”cgi-script” under Handler and “.example” under Extension(s).