• Resolved roxer82

    (@roxer82)


    My MySql is constantly crashing because someone (or something) is accessing a lot to my site with urls like https://www.mysite.com/?s=piramidalny.pl
    My error_log file says

    [1-Jul-2016 18:21:19 UTC] Error Lost connection to MySQL server during query de la base de datos de WordPress para la consulta SELECT SQL_CALC_FOUND_ROWS wp_posts.ID FROM wp_posts WHERE 1=1 AND (((wp_posts.post_title LIKE ‘%piramidalny.pl%’) OR (wp_posts.post_excerpt LIKE ‘%piramidalny.pl%’) OR (wp_posts.post_content LIKE ‘%piramidalny.pl%’))) AND (wp_posts.post_password = ”) AND wp_posts.post_type IN (‘post’, ‘page’, ‘attachment’) AND (wp_posts.post_status = ‘publish’) ORDER BY wp_posts.post_date DESC LIMIT 0, 10 realizada por require(‘wp-blog-header.php’), require_once(‘wp-includes/template-loader.php’), include(‘/themes/iconic-one-pro/search.php’), query_posts, WP_Query->query, WP_Query->get_posts

    I tried to do a redirect with htaccess

    RewriteCond %{QUERY_STRING} s=(.+)\.pl
    RewriteRule ^ /pagina.html? [R=301,L]

    But even if the redirect works ok, the search is done anyway.
    Do you know how to stop a search if it contains a text like “.PL”?
    Thanks in advance.

Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘URGENT: stop searches if it has ".pl" to avoid MySql to crash’ is closed to new replies.