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?
If you recently changed your IP address (i.e. you bought a dedicated IP or an SSL certificate),...
If you run a database driven website, it is important to backup your databases, periodically. You...
To password protect directory: Note: At this time, cPanel can only protect directories, not...
We support sending gzip files, or gunziping/gzipping files on the shared server. This is not the...
This is an advanced design tutorial. If you are a beginner, we recommend using the cPanel...