为什么符号链接会创建不必要的“文件夹”?

发布于 2024-09-17 20:24:59 字数 399 浏览 2 评论 0原文

假设我的服务器上的根文件夹是 /home/bong/www/,那么 mydomain.com 将从 /home/bong/www/ 提供 index.php。

然后我克隆了一个 hg 存储库并将其放置在 /home/bong/hg/hgrepo/ 中。

当我在 /home/bong/ 上时,我创建了如下符号链接,以便访问 mydomain.com 将提供 hg/hgrepo 目录中的内容:

ln -s hg/hgrepo www

当我进入 www 时,我看到 hgrepo -> 。 hg/hgrepo

问题是当我访问 mydomain.com 时,它仍然不起作用......但 mydomain.com/hgrepo 可以。

我做错了什么?

Say the root folder on my server is /home/bong/www/, so mydomain.com will serve up index.php from /home/bong/www/.

Then I cloned an hg repository and placed it at /home/bong/hg/hgrepo/.

When I am on /home/bong/ I created a symlink as follow so that going to mydomain.com will serve up content from the hg/hgrepo directory:

ln -s hg/hgrepo www

When I go into www, I see hgrepo -> hg/hgrepo

Problem is then when i go to mydomain.com, it still doesn't work ... but mydomain.com/hgrepo does.

What did I do wrong?

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

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

发布评论

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

评论(1

断念 2024-09-24 20:24:59

我敢打赌 www 已经存在,因此当您创建链接时,它会将其放在已经存在的目录中。解决方案:删除www,然后重新创建链接。

I'm betting that www already existed, so when you created the link, it placed it inside the directory that was already there. Solution: delete www then create the link again.

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