WordPress.org

Ready to get started?Download WordPress

Forums

Changing proposal for .htaccess generation/manipulation (2 posts)

  1. Stefano Lissa
    Member
    Posted 2 years ago #

    Today I found my .htaccess scrambled with the common rules of WordPress added to the beginning if the file and truncating a lot of custom rules.

    I think the problema was due to an odd issue while connection with a temporary FTP client to edit the file.

    On WP core (misc.php line 37) there is

    if ( $markerdata = explode( "\n", implode( '', file( $filename ) ) ));

    but if the file for some reason (auto text correction by FTP clients) has only a \r as end line... the rest of the function code likely scramble the .htaccess file.

    Can be solved with a pre-code doing a replacement for \r\n to \n and then \r to \n.

    My 15$ tip... the price to restore a backup, ihihihih...

    Stefano Lissa.

  2. TCBarrett
    Member
    Posted 2 years ago #

    My recommendation is to scrap .htaccess (and apache) all together :)

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags