I'm going to just post this question and I'll edit it if the community determines it needs elaboration or clarification.
The Issue
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:)
C:\Windows\System32\drivers\etc\hosts
and tried all of the following, to no avail:
Direct url conversion
smile.amazon.com amazon.com
Pinged with CMD to get URL for smile.amazon.com (54.239.26.123)
54.239.26.123 amazon.com
Added the www subdomain routing as well
54.239.26.123 amazon.com 54.239.26.123 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:
ipconfig /flushdns
ping smile.amazon.com Pinging smile.amazon.com [54.239.26.123] with 32 bytes of data: Request timed out.
C:\WINDOWS\system32>nbtstat -R Successful purge and preload of the NBT Remote Cache Name Table.
Certificate/Saftey Errors
After making the above changes I get this error:
Chrome:
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:
(https[crossed-out])://www.amazon.com
My Questions
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?