简体   繁体   中英

Changes to .htaccess file keep crashing my Wordpress site

A while ago, I started having a problem where every few days, my Wordpress site would crash. Instead of loading, the site would just download the contents of index.php.

After some investigation, I found that commenting out the following line in the .htaccess file solved the issue:

AddHandler application/php-70 .php

However, my comment on that line keeps getting over-written somehow.

So here are my questions:

  • Why is that line causing the issue, and can the root cause be addressed?
  • If the root cause can't be addressed, how can I prevent my comment on that line from being overwritten?
  • If I can't prevent the comment from being overwritten, can I add some sort of monitoring to show my what's causing changes to the .htaccess file?

Additional info: Wordpress 5.4.2 on SiteGround hosting

Seems like some plugin is overwriting your changes in .htaccess, check this link https://wordpress.org/support/topic/php-version-change-can-break-htaccess which addresses a similar problem.

Also, you can follow the instructions here https://www.siteground.com/kb/how_to_have_different_php_versions/ and you should (if you can) change/upgrade your php version to the required version.

Alternately, you can chmod 655 .htaccess file to disable any plugins writing to it.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM