在撰寫 PHP 網站時
若不想讓網站的目錄結構被看到
可以在 Apache 目錄裡的 conf 資料夾中
找到一個 httpd.conf 的檔案
用記事本打開後
在裡面找到下面的這段設定
<directory "C:/AppServ/www">
#
# Possible values for the Options directive are "None", "All",
# or any combination of:
# Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
#
# Note that "MultiViews" must be named *explicitly* --- "Options All"
# doesn't give it to you.
#
# The Options directive is both complicated and important. Please see
# http://httpd.apache.org/docs/2.2/mod/core.html#options
# for more information.
#
Options Indexes FollowSymLinks MultiViews ExecCGI
#
# AllowOverride controls what directives may be placed in .htaccess files.
# It can be "All", "None", or any combination of the keywords:
# Options FileInfo AuthConfig Limit
#
AllowOverride All
#
# Controls who can get stuff from this server.
#
Order allow,deny
Allow from all
</Directory>
<directory "C:/AppServ/www"> 代表是此 C:/AppServ/www 目錄的設定
在下面的 Options Indexes FollowSymLinks MultiViews ExecCGI
將 Indexes 拿掉
變成 Options FollowSymLinks MultiViews ExecCGI
其它人就看不到網站的目錄結構了
分享