1

If I use Admin Tools to create a .htaccess file the site downloads the index.php file instead of serving it. What setting causes this, why does it occur, can it be fixed, and what are the implications of fixing it?

1

If your server downloads index.php instead of executing it, look in your .htaccess file for directive similar to

AddHandler x-mapp-php5.5  .php  

and comment it out (put # at the begining of line).

That should resolve your problem.

  • Thanks, that was all of the advice I had, I believe this is correct. So is there a way to set the PHP version using .htaccess? It used to work. – Eoin Jun 2 '17 at 16:29
  • 1
    I remember in old days on shitty GoDaddy hosting I used directive addhandler x-httpd-php5 .php to set PHP5 on some site. But today on modern hosting (read SiteGround) that doesn't work or its not neccessary anymore because they have setting PHP version via WHM cPanel. – Mikan Jun 2 '17 at 20:23
  • Ah I thought the PHP version manager created a .htaccess file. Maybe that has changed. – Eoin Jun 3 '17 at 15:02
1

An .htaccess file should be compatible with the server in order to work and to not create issues.

Admin Tools .htaccess maker mentions that there is no guarantee that the produced .htaccess will work at your server. There are so many possible server configurations and there is not necessarily a particular setting that may cause specific side-effects and certainly with the information given in your question it's hard to tell - as we don't know both what your .htaccess looks like and also how your server is configured.

Either build step by step your .htaccess to see what's causing your issues - or collaborate with your hosting provider on the issue.

  • Thanks, I'll report back if I find it. My server is Siteground, but to be honest I've had the same symptoms on other servers. – Eoin Jun 1 '17 at 17:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.