Updating Permalinks breaks site with strange code in .htaccess

Hi there,

I have recently built a site at http://hakubaskiconcierge.flickdigital.co/ and migrated it to http://hakubaskiconcierge.com/

On migrating the site works fine until I save permalinks. Everytime I do so it adds a strange line to .htaccess:

AddHandler application/x-httpd-php70 .php

Once this code is in the file, instead of the site working, clicking on any link causes the browser to download the files such as “options-permalink.php”, “download” etc. Manually removing this line allows the site to work fine, but the same problem occurs everytime permalinks are saved.

The php version of the staging site and the live site is 5.6. The staging site has the above line in it’s .htaccess by default, as well as the below 2:

# Use PHP5.6 as default
AddHandler application/x-httpd-php56 .php

However if I add these lines along with the first above, the same error occurs.

GoDaddy (the client’s hosting) support were incredibly helpful and spent hours on it with several techs testing. They have pinned it down to a theme issue as the site works fine with other themes.

On the staging server it works fine, I can save permalinks etc no problems. There are no errors in console. There are no errors in console on the live site until saving permalinks.

I appreciate you looking into this and look forward to hearing back.

Let me know what you need from my side.

Thanks - Jade

FIXED! It was caused by Endurance Page Cache. My development site is Hostmonster and it is installed when WordPress is setup.

I went into the MU plugins folder and deleted the plugins and all was fine.

Hello There,

Thank you for writing in and for the very detailed post information.
We are happy that you have figured out what have been the cause of the issue and was able to resolve it right away. It’s good to know that it is working fine now.

Best Regards.

I am experiencing this same problem. I have not yet determined what is inserting the line of code into .htaccess. Will report back.

Did you see this above? It could be your issue.

Hey @sc8tty,

Please apply @freedomdesign’s fix and let us know if the issue remains.

Thanks!