我是如何设法在通常的 conf 设置之外定义一个 XAMPP Apache 额外目录的?找不到证据



我可以通过浏览器访问Apache,http://localhosthttp://127.0.0.1访问D:ApplicationsXAMPPhtdocs根目录下的php文件。但是,我可以导航到http://127.0.0.1/projects/http://localhost/projects/来访问D:Documentsprojects中的文件。但? 我是如何配置它的?

据我所知,我在D:ApplicationsXAMPPapacheconfhttpd.conf中没有别名。文档路由仍然是htdocs,在同一个文件(D:ApplicationsXAMPPapacheconfhttpd.conf)中。我在D:ApplicationsXAMPPapacheconfextrahttpd-vhosts.conf中没有虚拟主机。

Windows通过文本文件搜索无法在D:ApplicationsXAMPPapache文本文件中找到任何对搜索词/projects(或projects)的引用。

我在哪里通过导航到http://localhost/projects/D:Documentsprojects定义为Apache的可访问文件夹?

问了不到5分钟,经过几个小时的努力,我突然找到了答案。

我有别名。

D:ApplicationsXAMPPapacheconfhttpd.conf中,我写了Include "conf/alias/*.conf"行,这意味着我可以在D:applicationsxamppapacheconfalias中定义别名,例如'D:applicationsxamppapacheconfaliasprojects.conf',其中定义了D:Documentsprojects的基本别名,代码为:

<Directory "D:/Documents/projects">
#
# 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 Includes 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.
#
Require all granted
</Directory>
Alias /projects "D:/Documents/projects"

相关内容

最新更新