I have a website made with wordpress 4.2.2. Sometimes my .htaccess is erase by an older version, which look like that.
# 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]
</IfModule>
# END WordPress
I’ve added many PermanentRedirect under the “RewriteRule . /index.php [L]” line. Only these lines desappears.
I already looked here and there
None of the plugins interract with the .htaccess and it’s not he whole content that disappear.
I don’t have any clue of what could be the origin of this issue.
EDIT: It seems that every time someone access the permalink setting page, the .htaccess is erase.
WordPress considers anything between the
# BEGIN WordPress
and# END WordPress
to be its “territory”. It uses those comments to find and replace its own rules when updates are necessary.If you want to add custom rules, you must add them outside that block so WordPress does not overwrite them.
Sorry for the lack of update.
Still don’t know how my code got overwritten previously, but putting my rules outside
# BEGIN WordPress
and# END WordPress
comment-line did the trick.