当前位置:Gxlcms > PHP教程 > 本地计算机ip+端口如何在windows系统的hosts文件中绑定自定义域名

本地计算机ip+端口如何在windows系统的hosts文件中绑定自定义域名

时间:2021-07-01 10:21:17 帮助过:130人阅读

本地是php的集成环境 PhpStudy ,搭建了一个站点:

图一
系统文件这样写的:

# 102.54.94.97 rhino.acme.com # source server
# 38.25.63.10 x.acme.com # x client host

# localhost name resolution is handled within DNS itself.
# 127.0.0.1 localhost

192.168.1.222:3034 www.yyg.cn

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

但是直接输入www.yyg.cn访问不了网站,只能用ip+端口 192.168.1.222:3034这样访问,请大家看看是什么原因呢,哪里写错了吗


回复讨论(解决方案)

192.168.1.222 localhost

端口不是这样用的。
host文件里不能带端口。
浏览器访问的网址域名后面带端口。

http://www.cmhello.com/phpstudy-1.html

好咯,我找到方法了, ,还是谢谢大家

人气教程排行