XAMPP:别名问题 - 错误 404

发布于 2024-11-28 03:36:09 字数 884 浏览 5 评论 0原文

我正在尝试别名: /htdocs/test/index.php

在我的 xampp/apache/conf/extra/httpd-xampp.conf 中,我有以下条目:

<IfModule alias_module>
<IfModule mime_module>
    Alias /test/ "D:/Installation/xampp/htdocs/test"
    <Directory "D:/Installation/xampp/test">
           <IfModule php5_module>
            <Files "index.php">
                php_admin_flag safe_mode off
            </Files>
        </IfModule>
        Order allow,deny
        Allow from all
    </Directory>
</IfModule>
</IfModule>

当我转到 http://localhost/test/,我得到显示的目录列表。当我输入此 URL - http://localhost/test/ 时,我想要此文件 - /test/ index.php 打开。

当我尝试直接访问此 URL“localhost/test/index.php”时,我收到“错误 404 未找到对象”消息。

我做错了什么?

I am trying to alias this:
/htdocs/test/index.php

In my xampp/apache/conf/extra/httpd-xampp.conf, I have the following entry:

<IfModule alias_module>
<IfModule mime_module>
    Alias /test/ "D:/Installation/xampp/htdocs/test"
    <Directory "D:/Installation/xampp/test">
           <IfModule php5_module>
            <Files "index.php">
                php_admin_flag safe_mode off
            </Files>
        </IfModule>
        Order allow,deny
        Allow from all
    </Directory>
</IfModule>
</IfModule>

When I go to http://localhost/test/, I get the directory listing shown. When I type in this URL- http://localhost/test/, I want to have this file- /test/index.php opened.

When I try to go to this URL directly "localhost/test/index.php", I get "Error 404 Object not found" message.

What am I doing wrong?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

心房的律动 2024-12-05 03:36:09

找到 httpd-xampp.conf 文件中包含以下内容的部分:

#
# DirectoryIndex: sets the file that Apache will serve if a directory
# is requested.
#
<IfModule dir_module>
    DirectoryIndex index.html index.htm
</IfModule>

将“index.php”添加到 DirectoryIndex 行。

Find the section of your httpd-xampp.conf file with the following:

#
# DirectoryIndex: sets the file that Apache will serve if a directory
# is requested.
#
<IfModule dir_module>
    DirectoryIndex index.html index.htm
</IfModule>

Add "index.php" to the DirectoryIndex line.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文