環境是wamp3,apache是2.4的,之前用wamp2.5的時候,documentroot指定為h:demo(主目錄下沒有index.php之類的),每次打開localhost是一個所有項目的目錄,這次更新完wamp3,發現開啟localhost是not found,但輸入localhost/test/ 能開啟專案(test下有index.php)說明documentroot什麼的設定是對的,我查了一下如何顯示apache目錄。
回答說http.conf中
Options Indexes FollowSymLinks
可我發現我是有這項的
<Directory "H:/Demo">
#
# 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.4/mod/core.html#options
# for more information.
#
Options Indexes FollowSymLinks
#
# AllowOverride controls what directives may be placed in .htaccess files.
# It can be "All", "None", or any combination of the keywords:
# AllowOverride FileInfo AuthConfig Limit
#
AllowOverride all
#
# Controls who can get stuff from this server.
#
# onlineoffline tag - don't remove
Require local
</Directory>
Options Indexes FollowSymLinks
去掉
Indexes
变为
Options FollowSymLinks