.htaccess deleted off local folder and in ftp site

Good evening,

I unfortunately deleted my .htaccess file off my local folder and ftp. I did this by trying to modify something in it for according to a report from seositecheckup, I don't know why I didnt save a copy first. I then deleted it afterwards from the ftp. I only loaded the site today, which was working perfectly, so my hosting provider does not have any backups of the file. Please could you point me in the right direction of recreating this? or restoring it. I do have a .bak file from this morning.

  • Vaughan
    • Support/SLS MockingJay

    Hi Claire,

    Hope you're well?

    If this was just a single site, you should be able to create a new .htaccess file.

    Then simply add the following code to the new .htaccess

    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    # END WordPress

    Hopefully the above should get you back & working.

    Hope this helps

  • Vaughan
    • Support/SLS MockingJay


    Yeah, that's the default.

    The other code is what other plugins such as cache plugins,defender, wordfence or whatever security plugins you may have installed could probably have added, so you should go through those plugins again and update the settings so that they will update the htaccess again.


Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.