这很可能是初学者的问题,但我似乎无法在任何地方找到修复程序,我发现处理它的几篇文章未得到答复(例如xampp in window 7 cannot access files in subfolder inside C:/xampp/htdocs)。XAMPP:在根目录的子目录中访问html页面
到目前为止,我有一个使用XAMPP的工作本地主机(必须将端口更改为8080),位于自定义文档根目录中。我可以加载index.html的,但是当我点击一个链接向subdirectoy:
<li><a href="examples/test.html"></a></li>
我得到以下错误:
Service unavailable!
The server is temporarily unable to service your request due to maintenance downtime or capacity problems. Please try again later.
If you think this is a server error, please contact the webmaster.
Error 503
localhost Apache/2.4.25 (Win32) OpenSSL/1.0.2j PHP/5.6.30
即使我在地址(http://localhost:8080/examples/test.html)直接键入在浏览器中,它也不起作用。
有人请指出这是否应该工作?或者,如果我应该在Apache配置文件中指定一些东西?
我还可以注意到,当浏览器(在本地主机之外)浏览html文件时,无论页面在目录中的位置如何,页面都可以正常工作并加载。谢谢你的帮助!
编辑: 这是我修改的conf文件的DocumentRoot部分:
#DocumentRoot "F:/Apps/xampp/htdocs"
DocumentRoot "F:/me/GitWorkDir/myproject_io"
<Directory "F:/me/GitWorkDir/myproject_io">
#
# 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 Includes ExecCGI
#
# 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.
#
Require all granted
</Directory>
你做任何在conf文件中修改documentRoot? –
是的,我确实更改了DocumentRoot目录(请参阅原始文章中的编辑)。这能解释这个问题吗?因为据我所知,即使在新的根目录中,本地主机也可以访问index.html,而不是在子目录中。 – sc28