1

我的目标是在访问 wp-includes 目录中的任何内容时将用户重定向到自定义 404 页面。我试图隐藏我正在运行 WordPress 的任何证据并阻止任何黑客。

我不想要 Apache 默认设置的默认 Forbidden 消息,因此请改用 WordPress 404.php 模板之一。

我已经尝试过 HTACCESS 文件方法,但它会影响任何 css、jpg 和 js 文件。你能帮忙的话,我会很高兴。

4

1 回答 1

1

您应该阅读 wordpress 文档。他们在Hardening Wordpress上有一整页。请参阅保护 wp-includes 部分:

http://codex.wordpress.org/Hardening_WordPress#Securing_wp-includes

# Block the include-only files.
RewriteEngine On
RewriteBase /
RewriteRule ^wp-admin/includes/ - [F,L]
RewriteRule !^wp-includes/ - [S=3]
RewriteRule ^wp-includes/[^/]+\.php$ - [F,L]
RewriteRule ^wp-includes/js/tinymce/langs/.+\.php - [F,L]
RewriteRule ^wp-includes/theme-compat/ - [F,L]

# BEGIN WordPress
于 2013-01-31T20:49:01.460 回答