MIME Types
Note: Some web hosts will not allow you to add htaccess files manually. Always check to see if the option to add password protection or add MIME types is available through your web host's control panel first. Otherwise, if your host does allow htaccess mods, use the following fixes:
Htaccess files are just text files that have the name .htaccess (without the .txt extension). You may not be able to view these files without using the file manager that comes with your web host's control panel or setting your FTP program to view hidden files.
Adding Permissions
To password protect your template directory, create an .htaccess file and include the following lines:
AuthType Basic
AuthName "Protected"
require valid-user
Then load that file into the template directory and the file will be protected. You won't be able to log into that file unless you set a user/password, but that shouldn't be necessary with this directory, because you will never need to access it from the browser.
Adding a MIME Type
If your web host has a MIME Type administration area, you can use this area to parse your PHP pages as .htm or .html. Please Note! If you use the .htaccess files below, you must also use the above .htaccess file to password protect your /template/ directory!!! To update your MIME type, use the following settings:
MIME Type: application/x-httpd-php
Extension(s): .php .htm .html
What if that didn't work?
If your host does not have a MIME Type administration area, and you are allowed to modify your .htaccess file, create an .htaccess file as described above, putting it into the main directory and add the following line to the file. Or, if the file already exists, just add this line:
AddType application/x-httpd-php .php .htm .html
Please Note! Mime types are different depending on your server setup, and we cannot tell you what line(s) your server needs. For best results, ask your web host for this information. If you cannot get this information from your web host, and the above line doesn't work (ie. it causes an error when you try to view .htm or .html pages, or it just doesn't process the PHP code on a .htm or .html page), you can try any of the following. IMPORTANT!
- OR - - OR - - OR - - OR - - OR - - OR - - OR - - OR - - OR - - OR - - OR - - OR - - OR - - OR - - OR - - OR - - OR - - OR - - OR - - OR - - OR - For Servers Using PHP (general) - OR - - OR - - OR - - OR - - OR - - OR - - OR - - OR - - OR - - OR - Make sure to use the right type (ie. a RemoveType for an AddType, a RemoveHandler for an AddHandler). If none of the above work, your only option is to get this information from your web host.AddType application/x-httpd-php .php .htm .html
AddHandler application/x-httpd-php .php .htm .html
AddType x-mapp-php .htm .html
AddHandler x-mapp-php .htm .html
AddType x-httpd-php .php .htm .html
AddHandler x-httpd-php .php .htm .html
RemoveType .htm .html
AddType application/x-httpd-php .php .htm .html
RemoveType .htm .html
AddType x-mapp-php .htm .html
RemoveHandler .htm .html
AddHandler application/x-httpd-php .php .htm .html
RemoveHandler .htm .html
AddHandler x-mapp-php .htm .html
RemoveHandler .html .htm
AddHandler server-parsed .htm .html
AddType x-httpd-php .php .htm .html
AddHandler application/x-httpd-php .php .htm .html
AddType application/x-httpd-php5 .php .htm .html
AddHandler application/x-httpd-php5 .php .htm .html
AddType x-mapp-php5 .htm .html
AddHandler x-mapp-php5 .htm .html
AddType x-httpd-php5 .php .htm .html
AddHandler x-httpd-php5 .php .htm .html
RemoveType .htm .html
AddType application/x-httpd-php5 .php .htm .html
RemoveType .htm .html
AddType x-mapp-php5 .htm .html
RemoveHandler .htm .html
AddHandler application/x-httpd-php5 .php .htm .html
RemoveHandler .htm .html
AddHandler x-mapp-php5 .htm .html
RemoveHandler .html .htm
AddHandler server-parsed .htm .html
AddType x-httpd-php5 .php .htm .html
AddHandler application/x-httpd-php5 .php .htm .html
AddType application/x-httpd-php .php .htm .html
AddHandler application/x-httpd-php .php .htm .html
AddType x-mapp-php .htm .html
AddHandler x-mapp-php .htm .html
AddType x-httpd-php .php .htm .html
AddHandler x-httpd-php .php .htm .html
RemoveType .htm .html
AddType application/x-httpd-php .php .htm .html
RemoveType .htm .html
AddType x-mapp-php .htm .html
RemoveHandler .htm .html
AddHandler application/x-httpd-php .php .htm .html
RemoveHandler .htm .html
AddHandler x-mapp-php .htm .html
RemoveHandler .html .htm
AddHandler server-parsed .htm .html
AddType x-httpd-php .php .htm .html
AddHandler application/x-httpd-php .php .htm .html