WordPress’s block in your .htaccess file looks mostly like this:
# 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
Are you placing your custom rules *inside* # BEGIN WordPress and # END WordPress or outside of that block?
@james Huff, Outside the block. I have experimented with both before the block and after the block with no difference. The .htaccess file consists of just the WordPress block and a fairly long (about 20kb) list of 301 Redirect lines.
Do you have any plugins which have features that add to your .htaccess file, like security plugins?
@james Huff. I have a malware scanner plugin, no extra security plugin I do have a SEO plugin that allows you to edit the .htaccess file and I tried editing the .htaccess file from within the plugin but no difference, it still quickly reverted back. In addition I tested disabling all plugins and the behavior did not change.
Do you have an ftp client such as Filezilla? If so, and if the htaccess is in the root, you can replace it through ftp.
@neotechnomad I have no trouble replacing the .htaccess file, the problem is that within seconds of doing so something is changing it back to the default.
Deactivate that SEO plugin, then edit your .htaccess file. Is the file reverted almost immediately after?
Could this be a problem with your host, in that your host automatically reverts your rewritten .htaccess to their default?
From the Codex: (https://codex.wordpress.org/Using_Permalinks#Where.27s_my_.htaccess_file.3F)
“Some hosts (e.g. Godaddy) may not show or allow you to edit .htaccess if you install WordPress through the Godaddy Hosting Connection installation.”
@james Huff: made no difference. The edited version was replaced with the default in less than a minute.
Ok, who is your hosting provider? Is it one of those “Managed WordPress” hosts?
@james Huff. It is Godaddy, but it is not a Managed WordPress plan. I do however have several subsites in folders under the main site that are also running WordPress.
Is this a MultiSite Network, or a single site installation? Also, are the other sites affected?
Single site installation(s) and it does not seem that the other sites are affected although I may not be sure on that since the other sites do not need any redirects and thus only seem to need a standard .htaccess file.
Actually I just tested one of the subsites by making a test of changing their .htaccess file and it changed back as well.
Ok, contact your hosting provider, ask if they have anything in place to revert .htaccess files like that.