Home arrow FAQ arrow Web Hosting Technical arrow Changing Default PHP Script File Extensions
Sunday, February 25 2024
Main Menu
Contact Us
Copyright / DMCA
Changing Default PHP Script File Extensions PDF Print E-mail

By default, file names ending in .php or .php3 are interpreted as php scripts. If you would like to use a different extension, create a ".htaccess" file in the directory containing your scripts and add a line like the following:

AddType application/x-httpd-php php php3 asp

This will cause .asp files to be interpreted as PHP scripts as well as .php and .php3 files. Any number of extensions may be listed.

If you would like to have files with any unrecognized extension, or no extension at all, interpreted as PHP scripts, then you will need to change the default file type by putting the following in a ".htaccess" file:

DefaultType application/x-httpd-php

Just keep in mind that using non-standard extensions may make things difficult if you move to a different, less flexible host later on. Also, needlessly running files through PHP, for example, all HTML files including those with no scripting, can make your pages load a little slower.

HomeReliabilityNewsArticlesWeb LinksFAQPoliciesContact UsPrivacyCopyright / DMCA
Top of page

All logos and trademarks in this site are property of their respective owners.
All content is copyright © 2003-2005 Optimized Micro Devices LLC, except contributed items which remain the property of their authors.
Mambo is Free Software released under the GNU/GPL License and copyright © 2000-2005 Miro International Pty Ltd.