我需要阻止将新文件添加到我的托管文件夹中。我使用wordpress,我需要禁用将新文件添加到某些文件夹中。需要自定义htaccess
?我在wp-content
文件夹中使用此代码,但我需要一些来禁用任何新文件,例如themes
文件夹或wp-include
文件夹。
Order deny,allow
Deny from all
<Files ~ ".(xml|css|jpe?g|png|gif|js)$">
Allow from all
</Files>
我发现此代码将新文件阻止到wp-include文件夹
# 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]
有人能说服这条线吗?我想阻止包含wp-include和子文件夹中的任何新文件。这段代码那样做?感谢