为什么bin文件夹下的文件找不到?

发布于 2024-07-19 06:09:53 字数 250 浏览 7 评论 0原文

我在 httpdocs(www) 中创建了一个名为“bin”的文件夹,我放置了一个“test.html”只是为了显示“Hello Stackoverflow”,但是当我访问该页面时,即 http://domain.com/bin/test.html,它说找不到页面。 但是当我将文件移动到测试文件夹时,它会显示它应该是什么。 为什么?

I inside my httpdocs(www), i created a folder called "bin", i put an "test.html" just to display "Hello Stackoverflow", but when I go access the page, i.e http://domain.com/bin/test.html, it says Page Cannot Be Found. But when I move the file to test folder, it display what it should be. Why?

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

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

发布评论

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

评论(3

来世叙缘 2024-07-26 06:09:53

一般来说,作为一般良好安全实践的一部分,默认配置不会被配置为执行任何不正常的操作(例如执行 bin 目录中的操作以外的操作,或者通常不会在基本目录中发生的操作)。 总的来说,我想说你应该努力适应这一点,而不是违背常规。

In general, the default config, as part of generally good security practice won't be configured to do anything that isnt normal (like doing stuff other than executing stuff in the bin directory, or stuff that wouldnt normally happen in the base directory). In general, I'd say you should be trying to fit in with this, rather than going against the grain.

孤独难免 2024-07-26 06:09:53

可能是权限。

chmod 755 /Path/To/Bin/
chmod 644 /Path/To/Bin/test.html

Possibly permissions.

chmod 755 /Path/To/Bin/
chmod 644 /Path/To/Bin/test.html
浅笑依然 2024-07-26 06:09:53

除了明显的“检查权限”答案之外,假设您使用的是 Apache 服务器,您可能需要在每个文件夹中添加具有正确权限的 .htaccess 文件。

在其他文件夹中查找 .httaccess 并记住使用 ls -a (默认情况下隐藏以点开头的文件 -a = All )

顺便说一句,将 html 文件放在二进制文件夹中可能是一个不好的做法。

Apart from the evident "check permissions" answer and asuming you are using Apache server you may need to add a .htaccess file with the right permissions in each folder.

Look for .httaccess in other folders and remember to use ls -a ( file begining with dot are hidden by default -a = All )

By the way, it may be a bad practice to put html files in a binary folder.

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