繁体   English   中英

将.htaccess更改为禁止垃圾邮件链接

[英]Change .htaccess to forbid spam links

我的网站被黑了,垃圾邮件发送者创建的/up子目录中的许多链接都受到了很大的欢迎。

我已经清除了混乱( .htaccess重写和wp-stat.php文件,现在我想忽略/禁止对/up目录的所有请求。

目前,我有一个简单的wordpress创建的.htaccess文件,但是在重写规则接管并通过我的wordpress主题提供404页之前,无法找到将请求捕获到/up的方法。

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

您可以用此代码替换当前代码

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /

RewriteCond %{REQUEST_URI} ^/up(/.*|$) [NC]
RewriteRule ^ - [F]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^ index.php [L]
</IfModule>

这将禁止所有/up网址

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM