Title: .htaccess continually overwritten
Last modified: August 30, 2016

---

# .htaccess continually overwritten

 *  Resolved [RGrissom](https://wordpress.org/support/users/rgrissom/)
 * (@rgrissom)
 * [10 years, 9 months ago](https://wordpress.org/support/topic/htaccess-continually-overwritten/)
 * Hello,
 * I believe our site has been infected but I can’t seem to find the source. I have
   ran all the scans with your plugin, fixed the issues, removed old directories,
   changed passwords, prefixed the db tables, etc. but every time I try and fix 
   the permalinks the .htaccess overwritten and updated with a default setting and
   the permissions are changed. I can use an ftp client, delete the .htaccess file,
   upload a new one and within seconds its overwritten.
 * I forgot to mention that this is a blog (WP) installed under the main site, also
   WP. The 404 throws the user to the main site and not the blog which is exhibiting
   the issues.
 * Please advise.
 * [https://wordpress.org/plugins/gotmls/](https://wordpress.org/plugins/gotmls/)

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Plugin Author [Eli](https://wordpress.org/support/users/scheeeli/)
 * (@scheeeli)
 * [10 years, 9 months ago](https://wordpress.org/support/topic/htaccess-continually-overwritten/#post-6511996)
 * The .htaccess files is supposed to have some mod_rewrite code in it for your 
   permalink structure to work. What code is being written to your .htaccess file?
 *  Thread Starter [RGrissom](https://wordpress.org/support/users/rgrissom/)
 * (@rgrissom)
 * [10 years, 7 months ago](https://wordpress.org/support/topic/htaccess-continually-overwritten/#post-6512222)
 * Hi Eli,
 * No code was being written to the .htaccess file. The file was being replaced 
   every time I tried to update it manually or via the WP interface. The issue mysteriously
   disappeared just like when it mysteriously started exhibiting the issue.
 * I think because the site is on shared hosting that there were other issues behind
   the scenes. There was also an issue with the PHP version that the host said was
   affecting other sites too.
 * I’ve cleaned it all up and all is good now.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘.htaccess continually overwritten’ is closed to new replies.

 * ![](https://ps.w.org/gotmls/assets/icon-256x256.png?rev=1001824)
 * [Anti-Malware Security and Brute-Force Firewall](https://wordpress.org/plugins/gotmls/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/gotmls/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/gotmls/)
 * [Active Topics](https://wordpress.org/support/plugin/gotmls/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/gotmls/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/gotmls/reviews/)

## Tags

 * [htaccess](https://wordpress.org/support/topic-tag/htaccess/)
 * [overwritten](https://wordpress.org/support/topic-tag/overwritten/)

 * 2 replies
 * 2 participants
 * Last reply from: [RGrissom](https://wordpress.org/support/users/rgrissom/)
 * Last activity: [10 years, 7 months ago](https://wordpress.org/support/topic/htaccess-continually-overwritten/#post-6512222)
 * Status: resolved