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.
System Mime Type defaults
Handler Code File Extensions
image/vnd.djvu djvu djv
application/perl pl plx ppl perl pm
application/x-director dcr dir dxr
application/xhtml+xml xhtml xht
image/jpeg jpeg jpg jpe
text/plain asc txt
audio/x-pn-realaudio ram rm
video/mpeg mpeg mpg mpe
application/x-httpd-php phtml php php3 php4 php5 php6
image/tiff tiff tif
application/xml xml xsl
model/iges igs iges
text/calendar ics ifb
application/smil smi smil
audio/mpeg mpga mp2 mp3
audio/basic au snd
text/sgml sgml sgm
application/x-tar tgz tar
model/mesh msh mesh silo
audio/x-aiff aif aiff aifc
video/quicktime qt mov
text/x-config cnf conf
application/x-troff t tr roff
audio/mp4 a-latm m4p m4a mp4
text/html html htm shtml
audio/midi mid midi kar
application/x-koan skp skd skt skm
application/x-netcdf nc cdf
model/vrml wrl vrml
application/postscript ai eps ps
application/x-texinfo texinfo texi
application/octet-stream bin dms lha lzh exe class so dll iso dmg
Was this answer helpful?
MySQL queries or tables stop working If you get an error which says, "so-and-so is marked as...
Incorrectly Set Permissions The mother of all errors, knowing what the file permissions need to...
There may be times when you wish to create, edit, or delete a file or folder in your account. You...
Your cPanel keeps disk space usage for your entire account, email accounts, databases, and other...
Permissions can be very important when it comes to hosting your website. Permissions can allow...