wordpress download file instead of opening in browser code example
Example 1: website download index file instead of opening in browser
inside .htaccess add a line
AddHandler application/x-httpd-php70 .php
Example 2: website download index file instead of opening in browser
Likely an incorrect mime type in your .htaccess file. I suggest going into it
and looking for any unwanted lines similar to the below and removing them.
AddHandler application/ etc.
and also ensure your type is set as follows:
AddType text/html .html
In order to open .htaccess in cPanel: Click File Manager and make sure to tick
Show Hidden Files (dotfiles) before clicking Go. Then the .htaccess should
show up the location where wp (wp-admin, wp-content, wp-includes) is installed.