大网数据广告活动
网站运营与故障问答

is HTTP in URL referring to ":80" port number?

· 52CE 我爱测

Why every browsers/internet clients defaults to :80 when you just type http://example.com I mean It took time for me to know browsers internally always add port :80

问题原文

原帖链接 · abdul rashid · CC BY-SA 4.0

Why every browsers/internet clients defaults to :80 when you just type http://example.com

I mean It took time for me to know browsers internally always add port :80

已采纳解答

原帖链接 · Stephen Ostermiller · CC BY-SA 4.0

The HTTP specification says so in section 3.2.2:

If the port is empty or not given, port 80 is assumed.

This is something that has been a part of HTTP since it was invented by Tim Berners-Lee. He chose the default port and allowed URLs to omit :80 to let it be the default. This was done presumably to make URLs cleaner.

HTTPS has a similar default port: port 443.

These kinds of technical details are useful to know if you are a webmaster. You might need to know them to configure a webserver or router. If you are at the level where this matters to you, you would probably find many other tidbits in the HTTP spec that would interest you. You should read it.

However, it is good that these details are typically hidden from users. URLs are confusing enough as it is. Users don't even need to know what a port is, let alone which one any particular URL is using.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Webmasters Stack Exchange
适用范围
以原帖系统、软件版本与发布日期为准(2020-01-09)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。