屏蔽状态栏中的 URL
我在运行 Ubuntu 服务器的个人服务器上托管我自己的网站。每当有人访问我的网站或将鼠标悬停在页面上的链接之一上时,我的公共 IP 地址就会显示在状态栏中(即,当转到主页时,它会显示正在等待 myipaddress/index.php)。我已经在godaddy购买了域名。虽然我能够在管理页面的地址栏中找到屏蔽 url 的选项,但我在状态页面上找不到这样的选项。最初,我尝试将 JavaScript 代码嵌入到 php 文件中,但后来我从各种帖子中学习(链接)我们无法控制状态栏中显示的内容。
我想要做的就是每次加载页面以及每次用户将鼠标悬停在链接上时显示我的域名而不是 IP 地址。我应该如何解决这个问题有什么想法吗?
I'm hosting my own website on my personal server running Ubuntu server. My public IP address is showing up in the status bar each time someone visits my sites or hovers over one of the links on the pages (i.e. when going to the home page it says waiting for myipaddress/index.php). I have purchased a domain name with godaddy. While I was able to find the option of mask the url in the address bar in the admin page, I was able to find no such option for the status page. Initially, I tried to embed JavaScript code into the php files but I later learnt from various posts (link) that we cannot control what is displayed in the status bar .
All I want to do is to display my domain name instead of my IP address each time the page loads and each time the user hover's over a link. Any ideas of how I should go about this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您应该让您的域名指向您的 IP 地址,并在您的服务器上设置站点来处理该域。然后所有请求都将发送到该域名,而不是直接发送到您的 IP 地址。
注意:很容易找到任何 Web 服务器的 IP 地址(基于域名),因此您无法真正隐藏它,但您可以对其进行设置,使其行为就像使用域名的任何常规站点一样而不是 IP 地址。
You should just have your domain name point to your IP address and setup the site on your server to handle that domain. Then all requests will go to that domain name instead of directly to your IP address.
Note: it's very easy to find the IP address for any web server (based on a domain name) so you can't really hide it, but you can set it up so that it behaves just like any regular site that uses a domain name instead of an IP address.
您是否做过任何连接网络服务器和域名的操作?您将需要名称服务器,通常您的域名提供商会提供您可以使用的东西,或者您可以运行自己的名称服务器。名称服务器就像网站的电话簿。它说可以在 IP 地址 123.whatever 处找到 mydomain.com。除非您在名称服务器“电话簿”中拥有条目,否则您将无法通过该域名访问它。
您还需要在网络服务器上进行一些设置,这样当它收到指向该域的请求时,它就会知道要提供什么服务,如果您使用的是 apache,那么它可能是相应配置文件中的虚拟主机条目。
Have you done anything to connect the webserver and the domain name? You're going to need name servers, often your domain provider will have something you can use, or you can run your own. The name server is like a phone book for websites. It says mydomain.com can be found at IP address 123.whatever. Until you have an entry in a name server 'phone book' you will not be able to access it through that domain name.
You'll also need to setup something on the webserver so it will know what to serve when it gets a request pointed to that domain, if you're using apache, likely it will be a virtual host entry in the appropriate config file.