I'm going to just post this question and I'll edit it if the community determines it needs elaboration or clarification.
I got what I thought was a brilliant idea today. I shop Amazon.com a lot. Amazon offers a program where a portion of all your purchases go to a charity of your choice called "Amazon Smile". You can choose to "activate" the charity by going to "smile.amazon.com" (a subdomain of amazon.com). I want to use the Windows 10 hosts file to redirect whenever I type "amazon.com" to go to "smile.amazon.com" automatically, so that my charity always benefits. Unfortunately, it is not working as I had hoped.
What I have Tried
First I opened Notepad.exe as admin. Then, I opened the hosts file from Notepad (path:)
and tried all of the following, to no avail:
Direct url conversion
Pinged with CMD to get URL for smile.amazon.com (126.96.36.199)
Added the www subdomain routing as well
188.8.131.52 amazon.com 184.108.40.206 www.amazon.com
None of it seems to have worked (when I type _amazon.com_ the address in the URL bar doesn't change to "smile.amazon.com"), however, there is some kind of certificate error. I tried 4 browsers including Firefox, Chrome, SeaMonkey, and IceDragon, (clearing cache on all of them), to no avail.
As per this Server Fault post, I tried this:
ping smile.amazon.com Pinging smile.amazon.com [220.127.116.11] with 32 bytes of data: Request timed out.
C:\WINDOWS\system32>nbtstat -R Successful purge and preload of the NBT Remote Cache Name Table.
After making the above changes I get this error:
Your connection is not private
Attackers might be trying to steal your information from www.amazon.com (for example, passwords, messages, or credit cards). NET::ERR_CERT_COMMON_NAME_INVALID
If I click "Advanced", I get this:
This server could not prove that it is www.amazon.com; its security certificate is from smile.amazon.com. This may be caused by a misconfiguration or an attacker intercepting your connection.
When I click to proceed to amazon anyway, the browser takes me to amazon.com and I see this in the url:
So, I guess what I want to know is:
- Is redirecting amazon.com to smile.amazon.com even possible through the Windows hosts file?
- How can I do it?
/etc/hostson a un*x system, but applies equally to what you are trying to do.