【问题标题】:Remove cache after hacked Wordpress site黑客入侵 Wordpress 网站后删除缓存
【发布时间】:2018-09-26 00:51:42
【问题描述】:

我的 Wordpress 网站被黑了。它将用户重定向到一些垃圾邮件网站。 由于我已经清理了网站,并且不再出现问题。

问题是,我的访问者仍然被重定向到垃圾邮件网站,直到他们清理缓存或停止重定向并重新加载页面。

我真的不知道该怎么做才能解决这个问题。我知道我无法远程删除用户的缓存,但肯定有某种方法可以告诉他们的浏览器,在重定向开始之前网站上有更改。

我已经将此代码添加到网站:

<meta http-equiv="cache-control" content="max-age=0" />
<meta http-equiv="cache-control" content="no-cache" />
<meta http-equiv="expires" content="0" />
<meta http-equiv="expires" content="Tue, 01 Jan 1980 1:00:00 GMT" />
<meta http-equiv="pragma" content="no-cache" />

有什么想法吗?

【问题讨论】:

  • 应该可以用 headers 做,在 metas 做的问题是发送304 Not Modified 时甚至没有提供 html,所以浏览器看不到它。
  • 请看文章2-viruses.com/…
  • @lawrence-cherone 感谢您的回答。我试图将其添加到 htaccess: Header set Cache-Control "no-cache, no-store, must-revalidate" Header set Pragma "no-cache" Header set Expires 0 和这个到我的 header.php header("Cache-Control: no-cache, no-store, must-revalidate"); // HTTP 1.1。 header("Pragma: no-cache"); // HTTP 1.0。 header("过期时间:0"); // 代理。但是还是不行
  • 您需要启用 mod_headers 模块以使其正常工作,请参阅stackoverflow.com/questions/13640109/… - 仅在 php 中执行此操作,将标头添加到您的配置或其他内容中,wp 是否没有插件来关闭缓存,如果没有,我会感到惊讶吗?
  • 如果所有其他方法都失败了,请确保您没有被感染,如果您刚刚从备份中恢复,这些问题会再次出现。

标签: php wordpress redirect caching malware


【解决方案1】:

我也遇到了这个问题,我将此代码添加到我的 .htaccess 文件中,以摆脱它。请尝试一下。

<IfModule mod_expires.c>
ExpiresActive on
ExpiresDefault "access plus 1 month"
ExpiresByType image/gif "access plus 1 month"
ExpiresByType image/png "access plus 1 month"
ExpiresByType image/jpg "access plus 1 month"
ExpiresByType image/jpeg "access plus 1 month"
ExpiresByType text/html "access plus 3 days"
ExpiresByType text/xml "access plus 1 seconds"
ExpiresByType text/plain "access plus 1 seconds"
ExpiresByType application/xml "access plus 1 seconds"
ExpiresByType application/rss+xml "access plus 1 seconds"
ExpiresByType application/json "access plus 1 seconds"
ExpiresByType text/css "access plus 1 week"
ExpiresByType text/javascript "access plus 1 week"
ExpiresByType application/javascript "access plus 1 week"
ExpiresByType application/x-javascript "access plus 1 week"
ExpiresByType image/x-ico "access plus 1 year"
ExpiresByType image/x-icon "access plus 1 year"
ExpiresByType application/pdf "access plus 1 month"
<IfModule mod_headers.c>
   Header unset ETag
   Header unset Pragma
   Header unset Last-Modified
   Header append Cache-Control "public, no-transform, must-revalidate"
   Header set Last-modified "Mon, 1 Apr 2017 10:10:10 GMT"
 </IfModule>
 </IfModule>

【讨论】:

  • 可能会起作用,如果遇到 500 错误,则注释掉 if 条件,然后 mod_headers.c 未启用。
  • 感谢您的提示。不幸的是,它对我不起作用。
  • 你可以在这里检查自己 - mezinami.cz
  • 它会重定向,但一旦我删除缓存,它就会开始正常工作。所以我不认为恶意软件仍然存在
  • 好的,我得再看看。我对此不明白的是,为什么在我删除缓存后重定向就停止了?我在多台电脑上试过,效果一样。
猜你喜欢
  • 2015-12-06
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2011-06-03
  • 1970-01-01
  • 2015-01-26
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多