• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Changing my hosts file is not working

#1
I'm trying to redirect bing.com to google.com, so when I enter bing.com on my browser address I should be redirected to google.com instead but it's just not working...

I opened the hosts file using notepad as an administrator, and change it to

172.217.25.110 bing.com # should redirect to google but not!

I'm trying to learn something and this is a part of the tutorial that I'm reading on, this is just an excerpt that is somehow related to Codeigniter.
Reply

#2
(01-17-2017, 11:16 PM)meSmashsta Wrote: I'm trying to redirect bing.com to google.com, so when I enter bing.com on my browser address I should be redirected to google.com instead but it's just not working...

I opened the hosts file using notepad as an administrator, and change it to

172.217.25.110 bing.com # should redirect to google but not!

I'm trying to learn something and this is a part of the tutorial that I'm reading on, this is just an excerpt that is somehow related to Codeigniter.

Especially if you are on Windows, it could be that as part of an anti-malware (virus, trojan, etc) defense, the operating system won't let you redirect bing.com to anywhere else.
Reply

#3
(01-17-2017, 11:16 PM)meSmashsta Wrote: I'm trying to redirect bing.com to google.com, so when I enter bing.com on my browser address I should be redirected to google.com instead but it's just not working...

Nowadays, every serious entity on the web only allows access via HTTPS/TLS.
And they also implement a TLS extension called SNI (server name indication), which for security reasons tries to block exactly what you're trying to do.

(01-17-2017, 11:16 PM)meSmashsta Wrote: I opened the hosts file using notepad as an administrator, and change it to

172.217.25.110 bing.com # should redirect to google but not!

No, it shouldn't.
You can't just point a hostname to an IP address and expect that to work flawlessly as a redirect - HTTP servers don't work that way.

(01-17-2017, 11:16 PM)meSmashsta Wrote: I'm trying to learn something and this is a part of the tutorial that I'm reading on, this is just an excerpt that is somehow related to Codeigniter.

That something mentions CodeIgniter, doesn't mean this is related. It is in no way related.
Reply

#4
Webservers tend to be configured for just predefined domains. Based on the requested domainname a specific virtual host (or wildcard) is selected.

If you want to create such a redirect you're better off linking bing.com to your locallhost, setup apache to serve for bing.com and have a script perform a redirect to Google.
Reply


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2019 MyBB Group.