0

How can we protect our htaccess file?

This code has appeared there several times now: (inserted by hackers)

RewriteBase /
RewriteCond %{HTTP_USER_AGENT} (google|yahoo|msn|aol|bing) [OR]
RewriteCond %{HTTP_REFERER} (google|yahoo|msn|aol|bing)
RewriteRule . concernedly-conferrable.php [L,S=10000]

It redirects Google traffic away from our site. We changed all the passwords but after a few weeks the same problem again.

Many thanks

Andrew Schulman
  • 8,561
  • 21
  • 31
  • 47
Daniel
  • 1
  • 1
    Do these answers help? [How do I deal with a compromised server?](https://serverfault.com/questions/218005/how-do-i-deal-with-a-compromised-server), [What permissions should my website files/folders have on a Linux webserver?](https://serverfault.com/questions/357108/what-permissions-should-my-website-files-folders-have-on-a-linux-webserver), [Tips for Securing a LAMP Server](https://serverfault.com/questions/212269/tips-for-securing-a-lamp-server) – Andrew Schulman Feb 21 '21 at 12:42
  • hows about to check the file permissions? – djdomi Feb 21 '21 at 13:49
  • It could be a vulnerable web application, perhaps a Wordpress plugin. Please provide more details about your web server. I would also look at web server logs. Perhaps try to see if you can correlate thet web server logs with the date/time that .htaccess file was last updated – Kate Feb 21 '21 at 16:47

0 Answers0