We have received several inquiries from WordPress Doctor customers about cases of HTACCESS disappearing, settings being cut off in the middle, and 500 errors.
HTACCESS processing of SiteGuard plugin
The SiteGuard plugin is probably the most popular plugin in the country, primarily for increasing security on WordPress login screens, and is an excellent, easy-to-configure plugin with a full range of features.
However, we have received several inquiries from WordPress Doctors about the disappearance of HTACCESS, and in those cases, this plugin is almost always installed, and we have received reports that the situation improved when this plugin was deactivated.
The reason why the SiteGuard plugin may cut or erase HTACCESS in rare cases.
We have investigated the cause of this problem and found that there are some parts of the code in the following file.
File name wp-content/plugins/siteguard/classes/siteguard-htaccess.php
This code means that the contents of the HTACCESS file are read, processed, and saved one line at a time, 4096 characters (bytes) at a time.
However, this code may cause problems.
1 Multiple lines are read as one line when the line feed code is not \n
2 If the line contains more than 4096 characters (bytes), it will be cut off at that number of bytes.
3 If HTACCESS is cut off at 4096 characters (bytes) on the way as described above, other plugin settings cannot be read, and HTACCESS may be emptied.
4 If HTACCESS is cut off in the middle of the above, HTACCESS configuration will be malfunctioned and may cause a 500 error
At this time, no update is provided for this part of the plugin, so if the server or other plugins are writing settings in a newline code other than Јn, there is a possibility, although very rare, that the above problem of htaccess breaking in the middle may occur.
Free WordPress:Malware Scan & Security Plugin [Malware and Virus Detection and Removal].