如何引用本地服务器地址的锚标记

How to reference an anchor tag of local server address

有没有办法通过本地主机地址引用锚标记。例如 rails 的 0.0.0.0:3000 或机架应用程序的 0.0.0.0:9292。使用 rails,您始终可以使用 pow 进行托管。它会将 url 人性化为 appname.dev/#thing。这将工作。就我而言,我正在尝试在机架应用程序中执行此操作。

喜欢 0.0.0.0:9292#hello 或 0.0.0.0:9292/#hello

它一直带我去 google 搜索。 我问这个问题的原因是因为我想测试一个我试图使用锚点从 URL 打开的精美盒子。我不想在生产中对此进行测试。

我尝试过的东西 -> 在 Chrome、Firefox 和 Safari 上

http://0.0.0.0:9292/#speaker1
http://0.0.0.0:9292#speaker1
0.0.0.0:9292/#speaker1
0.0.0.0:9292#speaker1

localhost 不是 127.0.0.1 吗?

From Wikipedia

In the Internet Protocol version 4 the address 0.0.0.0 is a non-routable meta-address used to designate an invalid, unknown or non applicable target.

如果您正在使用主机文件重定向 127.0.0.1 到该 ip,请尝试使用有效的 ip 地址!

你应该做的另一件事是使用 127.0.0.1/#hello 而不是 127.0.0.1#hello 以避免混淆!

0.0.0.0 不是有效的 IP 地址。它对包含所有 IP 地址的网络的引用。所以我建议尝试

http://127.0.0.1:3000/#hello

访问本地主机