These steps explain how to correct a website prompting a file download instead of displaying the actual page content. A potential cause is the PHP AddHandler line in the .htaccess file. This can be resolved by commenting out this line and saving the file. Access to cPanel is needed to complete this process.
Resolve AddHandler Causing Site Download
- Log into cPanel
- Locate and click the File Manager icon in the Files area
- Navigate to the Document Root of the affected website
- Locate the .htaccess file and right-click on it
NOTE: Make sure to unhide any hidden files, if needed. - Select Edit
- Locate the following line:
AddType application/x-httpd-ea-phpXX .php .phpX .phtml
TIP: If the above line is not in the .htaccess file in the document root, check the .htaccess file in the home directory.
- Comment out this line by placing # at the beginning
EXAMPLE:#AddType application/x-httpd-ea-phpXX .php .phpX .phtml
- Click Save Changes
- Refresh the site to confirm the issue is resolved