• Resolved dwnfred

    (@dwnfred)


    Hello,
    I had a strange thing this morning at 4:11AM (UTC+2) after an automatic wp 5.4.1 update (WordPress repository is on a folder called /V2/) it edited the index.php in the root repo
    Do you know why it edited a file that is not in the wordpress repository could be edited ?
    the index.php in root repo is edited to point to /v2/ website after the auto update it brokes the website and pointed to old website…

Viewing 4 replies - 1 through 4 (of 4 total)
  • I’m not sure which index.php you are talking about. May you provide a full path to the file?

    In future if you want to modify the way WordPress core functions it is recommended you create a plugin, theme, or child-theme and edit the files of one of those. It is recommended that you do not edit WordPress Core files as stated in the documentation. When WordPress updates it replaces old core files with new ones and any edits made to them may be lost.

    It is also recommended that you create regular backups so that you can roll back in the event issues occur when there is an update.

    Thread Starter dwnfred

    (@dwnfred)

    Here is what I mean :
    WordPress Address (URL) : https://mysite.com
    ite Address (URL) : https://mysite.com/v2

    Server File path : httpdocs/
    Website version 2 : httpdocs/v2/

    httpdocs/index.php is edited to point the website to /v2/

    after auto update wordpress 5.4.1 my edited index.php file was re-created with a default index.php which points wordpress site to httpdocs/

    hope is it clear ?

    I never had this situation, when I update a WordPress in a subdirectory like /v2/ it doesn’t erase any file in root httpdocs

    Alright, I understand now. Your edited root index.php has been replaced by the updated version. You may have avoided this issue for a long time because WordPress updates were only replacing files with changes and the root index.php doesn’t frequently receive changes.

    There are other ways to rewrite/redirect the site to the subdirectory. I cannot immediately give detailed advice on how as I’d need to research but it can be achieved with an “.htaccess” file. WordPress does not replace the “.htaccess” file so your changes should be safe.

    Thread Starter dwnfred

    (@dwnfred)

    Ok thanks I will check
    It is new for me since many years but OK I will pay attention to that now
    Kind regards

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘WordPress 5.4.1 auto update editing index.php’ is closed to new replies.