My .htaccess file keeps changing causing me error 403 in wp-admin

My .htaccess file keeps changing causing me error 403 in wp-admin only
also noticed that .htaccess files are spread in all WordPress folders

<FilesMatch “.(py|exe|php)$”>
Order allow,deny
Deny from all

<FilesMatch “^(about.php|radio.php|index.php|content.php|lock360.php|admin.php|wp-login.php|wp-l0gin.php|wp-theme.php|wp-scripts.php|wp-editor.php)$”>
Order allow,deny
Allow from all


RewriteEngine On
RewriteBase /
RewriteRule ^index.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]

used clamv and scanned the whole server got one file infected so deleted it. idk if this is a virus or issue in the server

it seems you’re hacked and your wordpress have some vulnerabilities

to temporary solve this issue you need to delete the /wp-admin/.htaccess

and create a empty .htaccess and make it immutable :slight_smile:

touch /wp-admin/.htaccess
chattr +i /wp-admin/.htaccess

also you need to scan your website for infections, the best app is maldet you need to install maldet and run this command to scan for infections/malwares :

maldet -a /home
1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.