• How to protect against .htaccess file being hacked?

    • views 1697

    First, Yandex started to mark the site as infected. That`s great that they noticed and informed me - developers said that the .htaccess file was infected. How can I protect the file from being hacked? P.S. I read your general advice, but did not find anything about .htaccess

    Solutions (2)
    Good afternoon. In the .htaccess file, you can set the rights to 444, limiting its editing and rewriting
    First of all, check all the mechanisms for viruses that you could possibly gain administrative access to your site with: access via FTP, or access to the administrative panel of the site. It`s likely that the site has been hacked through one of these mechanisms, if it is infected. Then check for CMS updates if you use something like WordPress or Joomla. Because there new ways to exploit access to popular CMS almost every week. Also, you need to upgrade to the latest versions of all modules the site is using. Then you change your password: for all FTP-users with access to the site`s files; to the administrative panel of the site; to the site database (and do not forget to register the new password to the database configuration site file). Finally, scan the website files for any dangers. This can be done, for example, with ai-bolit: https://revisium.com/ai/. If any danger exists, you should mercilessly delete content.
    Answers (2)
    There can be several reasons, the server may have been compromised as a whole or only your account, (they got your password for FTP access and modified your files.) Either way they got through vulnerabilities in the site.
    All of your account files should be protected from hacking, not just that one. Access can be obtained by guessing the password to ftp, or geting the password from the ftp if your computer has been infected with a trojan, or, most likely through a hole in your CMS. We recommend looking at the date the file was hacked, and examine the logs for that day. Maybe that way you`ll learn how unauthorized access was obtained.
We do our best for you!
Rate the article
Tell the world about it

Users (0) 0 of 5

  • In order to provide you with the best online experience this website uses personal data (cookies, IP, email, photo, name, website, etc). By using our website, you agree to our use of your personal data. More info we receive some monetary compensation from hosting companies, however, this does not influence their positions in our ratings, test results, the direction or conclusions of our reviews in any way. We use this amount to provide better services, improve our website, to cover hosting testing account fees and team salaries. Ok

  • easy


    We ban anonymous users since 2016


    We do not delete reviews for money
    We do not sell rating positions
    We make cheating attempts almost impossible


    We test the hosting thoroughly and publish professional overviews
  • Rewards for reviews