如何在windows“主机文件"中添加条目这样它就可以通过https重定向 [英] How to add entry in windows "host file" such that it can redirect over https

查看:151
本文介绍了如何在windows“主机文件"中添加条目这样它就可以通过https重定向的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当请求发送到 xyz.com 时,我想将所有浏览器请求重定向到 abc.com我可以通过在 windows 下的 hosts 文件中添加一个条目来做到这一点.

I want to redirect all my browser request to abc.com when a request is sent to xyz.com I was able to do this by adding an entry in the hosts file under windows.

但是我发现我可以在输入 http://abc.com 时访问 http://xyz.com:8080但我似乎无法通过 https 获得相同的重定向.

However I see that i can go to http://abc.com when i type in http://xyz.com:8080 but I cannot seem to get the same redirection over https.

我发现您不能在主机文件中提及端口.在这方面需要一些帮助

I found out that you cannot mention ports in the host file. Need some help on this

推荐答案

这不是 hosts 文件的用途.这是关于您所指的主机.abc.comxyz.com 是主机.

That's not what the hosts file is for. It's about the hosts that you are referring to. abc.com and xyz.com are hosts.

hosts 文件所做的只是将主机名与 IP 地址相关联.没有别的可能.

All the hosts file does is associate a host name with an IP address. Nothing else is possible.

这篇关于如何在windows“主机文件"中添加条目这样它就可以通过https重定向的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆