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?
Configuration Settings: Host = localhost (Keep this as localhost)Database name =...
Anonymous FTP is disabled by default. We do not recommend using Anonymous FTP as it is a...
GnuPG is a publicly available encryption scheme that uses the "public key" approach. With GnuPG,...
Sometimes when you edit the .htaccess file in cPanel, the lines must wrap and this causes a line...
If you recently changed your IP address (i.e. you bought a dedicated IP or an SSL certificate),...