如何判断一个页面是否是域名持有页面
有什么方法可以确定网络上的页面是否为保留页面?这是因为作为错误处理的一部分,我需要确定是否有任何curl 收到的页面由于域过期而不可用。
我以为在这种情况下会给出一个不同的 HTTP 代码,但结果却是 200 OK,这让事情变得很困难。
是在 PHP 中使用 strpos() 搜索特定短语的唯一方法吗?
任何帮助将不胜感激!
Is there any way to determine if a page on the web is a holding page? This is because I need to determine if any of curl recieved pages are unavailable due to the domain expiring as part of my error handling.
I thought that a distinct HTTP code would be given at this circumstance but instead I am given a 200 OK which has made things difficult.
Is the only way to search for specific phrases using strpos() in PHP?
Any help would be appreciated!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
没有可靠的方法可以做到这一点。有数百个不同的“域名持有页面”,并且所有这些页面都没有标准。
归根结底,域名持有页面只是一个与其他页面一样提供服务的网页,它们仅供人类可读。有些主机根本不会使用其中之一。
如果您收到域名保留页面,状态代码可能是 2xx 代码,但也可能不是。有些主机可能会选择使用 5xx 代码。再说一遍,没有真正的方法可以知道。
There is no reliable way to do this. There are hundreds of different "domain holding pages" and there is nothing standard to all of them.
At the end of the day, a domain holding page is just a web page that has been served like any other, they are intended only to be human readable. Some hosts wont use one at all.
If you ever recieve a domain holding page, the status code will probably be a 2xx code, but maybe not. Some hosts may choose to use a 5xx code. Again, there is no real way to know.
是的。域名持有页面与普通网站没有其他区别。
您可以搜索
不过,要实现 100% 的可靠性可能是不可能的。
Yup. There is nothing else distinguishing a domain holding page from a normal web site.
You could search for
It's probably going to be impossible to achieve 100% reliability though.
从技术上讲,保留页面只是一个页面。所以从技术上讲,您正在寻找一个页面。但然后呢?您能给出什么是保持页面的具体参数吗?这很难做到。
所以也许这有助于颠倒问题:
如果你更容易回答这个问题,那么你可能已经找到了一种方法。如果不是,那么旁边已经回答了:
但具体来说,如果您无法定义保持页面的特定特征,则无法确定一个页面是否符合编程语法。
Technically, a holding page is just a page. So you are technically looking for a page. But then? Can you give any specific parameters what a holding page is? That's hard to do.
So maybe it helps to invert the question:
If it's easier for you to answer that, you might have found a way. If not, next to what has already answered:
But specifically, if you can not define specific characteristics of a holding page, you can not decide whether or not one page is pro-grammatically.