• Resolved metaprinter

    (@metaprinter)


    I’ve updated one of my sites recently to https and all was well. After a WP auto update my inbound traffic stopped resolving to https. I checked the .htaccess file and to my surprise everything i had added in there was gone and only the vanilla WP rewrite remained.

    1. can someone verify that auto updates overwrite the .htaccess file?
    2. if it is overwritten, can you please point me to the WP documentation explaining this process
    3. if it is overwritten, what does WP recommend to get around this issue?

    Here is my current working code:

    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteCond %{SERVER_PORT} 80
    RewriteRule ^(.*)$ https://mysite.com/$1 [R,L]
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>
    
    # END WordPress

Viewing 2 replies - 1 through 2 (of 2 total)
  • I’d like to hear some discussion of this as well.

    I’m very surprised to learn that the automatic updater would ever touch the .htaccess file (if that’s the case).

    Can anybody verify that it does?

    WordPress will overwrite the entries between ‘# BEGIN WordPress’ and ‘# END WordPress’. While most plugins will create their own begin and end tags and only update within those tags.

    Simply put your custom entries outside of any custom tags/comments and they SHOULD be preserved when WP updates the file.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘WP Auto Updates overwriting my .htaccess file?’ is closed to new replies.