We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 37717
    • 38 Posts
    Hello, guyes, my hosting provider turn down my modx website ((MODX Revolution 2.6.1-pl) because of high load.
    I checked logs and see that there are many absurd GET requests like

    /kjhdsfkjh
    /index.php?q=dfkjhkjhkdgh
    /another_shit

    I think, this is web crawlers, search engines, botnets and script kiddies. My webserver responds by main page on any request. And hangs web server because main page is very huge and there is no cache for every absurd request.

    I made a 404 template, change error_page but it still do not work.

    I read forum, turn down all plugins on OnPageNotFound system event. Also i check all overriding system properties in another user and context and did not find any problem.

    But there is still main page generated in any request.

    How can i diagnose this problem and how can i fix it?

    Thank you for your help.
      • 3749
      • 24,544 Posts
      This list is out of date, but it might help to put it in your .htaccess file:

      RewriteCond %{REQUEST_URI} ^.*reflect [OR]
      RewriteCond %{HTTP_USER_AGENT} ^Sogou [OR]
      RewriteCond %{HTTP_USER_AGENT} ^BlackWidow [OR]
      RewriteCond %{HTTP_USER_AGENT} ^jplastiras [OR]
      RewriteCond %{HTTP_USER_AGENT} ^Bot\ mailto:[email protected] [OR]
      RewriteCond %{HTTP_USER_AGENT} ^ChinaClaw [OR]
      RewriteCond %{HTTP_USER_AGENT} ^Custo [OR]
      RewriteCond %{HTTP_USER_AGENT} ^DISCo [OR]
      RewriteCond %{HTTP_USER_AGENT} ^Download\ Demon [OR]
      RewriteCond %{HTTP_USER_AGENT} ^eCatch [OR]
      RewriteCond %{HTTP_USER_AGENT} ^EirGrabber [OR]
      RewriteCond %{HTTP_USER_AGENT} ^EmailSiphon [OR]
      RewriteCond %{HTTP_USER_AGENT} ^EmailWolf [OR]
      RewriteCond %{HTTP_USER_AGENT} ^Express\ WebPictures [OR]
      RewriteCond %{HTTP_USER_AGENT} ^ExtractorPro [OR]
      RewriteCond %{HTTP_USER_AGENT} ^EyeNetIE [OR]
      RewriteCond %{HTTP_USER_AGENT} ^FlashGet [OR]
      RewriteCond %{HTTP_USER_AGENT} ^GetRight [OR]
      RewriteCond %{HTTP_USER_AGENT} ^GetWeb! [OR]
      RewriteCond %{HTTP_USER_AGENT} ^Go!Zilla [OR]
      RewriteCond %{HTTP_USER_AGENT} ^Go-Ahead-Got-It [OR]
      RewriteCond %{HTTP_USER_AGENT} ^GrabNet [OR]
      RewriteCond %{HTTP_USER_AGENT} ^Grafula [OR]
      RewriteCond %{HTTP_USER_AGENT} ^HMView [OR]
      RewriteCond %{HTTP_USER_AGENT} HTTrack [NC,OR]
      RewriteCond %{HTTP_USER_AGENT} ^Image\ Stripper [OR]
      RewriteCond %{HTTP_USER_AGENT} ^Image\ Sucker [OR]
      RewriteCond %{HTTP_USER_AGENT} Indy\ Library [NC,OR]
      RewriteCond %{HTTP_USER_AGENT} ^InterGET [OR]
      RewriteCond %{HTTP_USER_AGENT} ^Internet\ Ninja [OR]
      RewriteCond %{HTTP_USER_AGENT} ^JetCar [OR]
      RewriteCond %{HTTP_USER_AGENT} ^JOC\ Web\ Spider [OR]
      RewriteCond %{HTTP_USER_AGENT} ^larbin [OR]
      RewriteCond %{HTTP_USER_AGENT} ^LeechFTP [OR]
      RewriteCond %{HTTP_USER_AGENT} ^libwww-perl [OR]
      RewriteCond %{HTTP_USER_AGENT} ^Mass\ Downloader [OR]
      RewriteCond %{HTTP_USER_AGENT} ^MIDown\ tool [OR]
      RewriteCond %{HTTP_USER_AGENT} ^Mister\ PiX [OR]
      RewriteCond %{HTTP_USER_AGENT} ^Navroad [OR]
      RewriteCond %{HTTP_USER_AGENT} ^NearSite [OR]
      RewriteCond %{HTTP_USER_AGENT} ^NetAnts [OR]
      RewriteCond %{HTTP_USER_AGENT} ^NetSpider [OR]
      RewriteCond %{HTTP_USER_AGENT} ^Net\ Vampire [OR]
      RewriteCond %{HTTP_USER_AGENT} ^NetZIP [OR]
      RewriteCond %{HTTP_USER_AGENT} ^Octopus [OR]
      RewriteCond %{HTTP_USER_AGENT} ^Offline\ Explorer [OR]
      RewriteCond %{HTTP_USER_AGENT} ^Offline\ Navigator [OR]
      RewriteCond %{HTTP_USER_AGENT} ^PageGrabber [OR]
      RewriteCond %{HTTP_USER_AGENT} ^Papa\ Foto [OR]
      RewriteCond %{HTTP_USER_AGENT} ^pavuk [OR]
      RewriteCond %{HTTP_USER_AGENT} ^pcBrowser [OR]
      RewriteCond %{HTTP_USER_AGENT} ^RealDownload [OR]
      RewriteCond %{HTTP_USER_AGENT} ^ReGet [OR]
      RewriteCond %{HTTP_USER_AGENT} ^SiteSnagger [OR]
      RewriteCond %{HTTP_USER_AGENT} ^SmartDownload [OR]
      RewriteCond %{HTTP_USER_AGENT} ^SuperBot [OR]
      RewriteCond %{HTTP_USER_AGENT} ^SuperHTTP [OR]
      RewriteCond %{HTTP_USER_AGENT} ^Surfbot [OR]
      RewriteCond %{HTTP_USER_AGENT} ^tAkeOut [OR]
      RewriteCond %{HTTP_USER_AGENT} ^Teleport\ Pro [OR]
      RewriteCond %{HTTP_USER_AGENT} ^VoidEYE [OR]
      RewriteCond %{HTTP_USER_AGENT} ^Web\ Image\ Collector [OR]
      RewriteCond %{HTTP_USER_AGENT} ^Web\ Sucker [OR]
      RewriteCond %{HTTP_USER_AGENT} ^WebAuto [OR]
      RewriteCond %{HTTP_USER_AGENT} ^WebCopier [OR]
      RewriteCond %{HTTP_USER_AGENT} ^WebFetch [OR]
      RewriteCond %{HTTP_USER_AGENT} ^WebGo\ IS [OR]
      RewriteCond %{HTTP_USER_AGENT} ^WebLeacher [OR]
      RewriteCond %{HTTP_USER_AGENT} ^WebReaper [OR]
      RewriteCond %{HTTP_USER_AGENT} ^WebSauger [OR]
      RewriteCond %{HTTP_USER_AGENT} ^Website\ eXtractor [OR]
      RewriteCond %{HTTP_USER_AGENT} ^Website\ Quester [OR]
      RewriteCond %{HTTP_USER_AGENT} ^WebStripper [OR]
      RewriteCond %{HTTP_USER_AGENT} ^WebWhacker [OR]
      RewriteCond %{HTTP_USER_AGENT} ^WebZIP [OR]
      RewriteCond %{HTTP_USER_AGENT} ^Wget [OR]
      RewriteCond %{HTTP_USER_AGENT} ^Widow [OR]
      RewriteCond %{HTTP_USER_AGENT} ^WWWOFFLE [OR]
      RewriteCond %{HTTP_USER_AGENT} ^Xaldon\ WebSpider [OR]
      RewriteCond %{HTTP_USER_AGENT} ^Zeus
      RewriteCond %{REQUEST_URI} !^/[0-9]+\..+\.cpaneldcv$
      RewriteCond %{REQUEST_URI} !^/[A-F0-9]{32}\.txt(?:\ Comodo\ DCV)?$
      RewriteCond %{REQUEST_URI} !^/\.well-known/acme-challenge/[0-9a-zA-Z_-]+$
      RewriteRule ^.* - [F,L] 


      Also, if you install the LogPageNotFound extra, you might find that most of the trouble is coming from a few IP addresses. You can then add them to the .htaccess in an allow/deny section so they will be blocked before they can request anything. Be careful not to block any major search engines, unless you don't need your pages to be found there.

      By default, the log maxes out at 300 lines, so until you block whoever is doing this, you will have to clear it often.
        Did I help you? Buy me a beer
        Get my Book: MODX:The Official Guide
        MODX info for everyone: http://bobsguides.com/modx.html
        My MODX Extras
        Bob's Guides is now hosted at A2 MODX Hosting
        • 37717
        • 38 Posts
        Thank you very much i just installed logpagenotfound plugin and it seems useful
        i see request to missing pages in logpagenotfound logfile but 404 error page still not working and i see main page

        i forgot to tell, that i already have similar rules in .htaccess but highload requests is still hangs my server (maybe it is better just pass /index.php?id=DIGIT and block any another request)

        i plan to optimise code of website for better speed, but anyway, this actions do not solve missing 404 error page

        i read your answer and description of plugin and suggested that problems can be in my .htaccess file with mod_rewrite rules
        so, i overwrite .htaccess by default file and there is still no 404 error page generated

        so, i still do not understand, where is problem
          • 3749
          • 24,544 Posts
          Make sure you have the MODX index.php page that the error_page System Setting is set to the page you want to be the "page not found" page. Make sure that page is published. Manually delete all files in the core/cache directory.

          If that doesn't work, try renaming .htaccess to ht.access and turning off the Friendly URL System Setting, then delete the cache files again.
            Did I help you? Buy me a beer
            Get my Book: MODX:The Official Guide
            MODX info for everyone: http://bobsguides.com/modx.html
            My MODX Extras
            Bob's Guides is now hosted at A2 MODX Hosting