wordpress · 2008-12-01

禁止浏览wordpress文件夹的方法

如何禁止别人通过web浏览wordpress文件夹,限制wordpress浏览文件夹的权限,其实很简单,就一句话,改完别忘记reload apache2。

root@debian:/etc/apache2/sites-available# vi default


# Options Indexes FollowSymLinks MultiViews
Options FollowSymLinks MultiViews /* 去掉 Indexes
AllowOverride None
Order allow,deny
allow from all
# This directive allows us to have apache2’s default start page
# in /apache2-default/, but still have / go to the right place
# RedirectMatch ^/$ /apache2-default/




reload apache2后,访问目录变成:

Directory Listing Denied
This Virtual Directory does not allow contents to be listed.