How to add an entry to the Windows "host file" so that it can redirect via https

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

However, I see that I can go to http://abc.com when I type http://xyz.com:8080 but I cannot get the same redirect via https.

I found out that you cannot specify ports in the host file. Need help with this

+6
redirect
source share
6 answers

This is not the hosts file. This is about the hosts you are talking about. abc.com and xyz.com are hosts.

All hosts files are associated with a host name with an IP address. Nothing else is possible.

+8
source

HTTPS is specially designed so that you cannot do it - this is not only one of the main SSL / TLS points in which the conversation is encrypted, it also ensures that you are really talking to who you consider yourself to be, you are not redirected to a fake site through DNS.

+11
source

Get a clone of the part you need from a genuine site .. put it on your local iis, add the ssl binding using a self-signed certificate and add an entry to the hosts file. http://www.selfsignedcertificate.com . if you are in a hurry, not having time to play with iis mgr, use appcmd.

You will receive an unverified warning for an unreliable issuer. Add it to trusted root certificates. http://www.robbagby.com/iis/self-signed-certificates-on-iis-7-the-easy-way-and-the-most-effective-way/

Never tried a self-signed certificate ... let's now, how your testing goes.

+2
source

A host file is a DNS that is used to resolve a domain name to IP addresses that has nothing to do with ports.

If you are redirected from https://abc.com to https://xyz.com , then they will need different servers with different certificates, since the SSL certificate is bound to a domain name.

This means that if you use the hosts file to search for the abc.com ip address when you try https://xyz.com , then it will not work because the certificate will be for abc.com and will not match the https: // host xyz.com submitted by your browser.

+1
source

With HTTPS, this will be associated with a security certificate - you probably won't be able to get around this, or at least ... I hope not.

+1
source

Use nslookup xyz.com and get IP

then put this IP address in hosts (/ etc / hosts on Linux)

https domain name must be converted to IP from

-2
source

All Articles