How do I use htaccess to manage my PHP file extensions?
NOTE: This content only applies to our Linux shared hosting accounts running Hosting Configuration 2.0. You can view the current configuration of your hosting under the Account Summary section of the Hosting Control Center in your customer account. See How do I upgrade my hosting account to run Hosting Configuration 2.0? for more information.
By default, files with a .php extension run under PHP 4 and files with the .php5 extension run under PHP 5. The .htaccess file, located at the root of your site, can be used to change these default settings. The following entries in a directory's .htaccess file designate .php files to run under PHP 5 and .php4 files to run under PHP 4.
AddHandler x-httpd-php .php4
Changes made to an existing .htaccess file will be seen immediately. When a new .htaccess file is created or an existing .htaccess file is deleted, however, these changes will not be seen until the htaccess cache is cleared. This occurs every hour.
You can also change your PHP version automatically through the Hosting Control Center. For more information on this process, see Changing Your PHP Language Version.