Windows Web Page Redirection

Have you ever went to a website like yahoo.com and have been redirected to lets say google.com? Or maybe you want to play a trick on a friend and redirect a popular site that you know he/she goes to, like point facebook.com to disney.go.com. Well, you’ve come to the right place.

On your computer, there is a hosts file that controls certain IP and domain addresses. It translates web addresses to IP addresses.

Wiki: “The hosts file is a computer file used in an operating system to map hostnames to IP addresses. The hosts file is a plain-text file and is traditionally named hosts.”

Open or navigate to the following file location:

C:\WINDOWS\system32\drivers\etc\hosts

You want to add additional lines in the following format to the end of the file.

Format:
<ip address> <website name>

Example:

68.71.208.75 facebook.com

68.71.208.75 points to disney.go.com, but you can use any IP address.

Original file:

 # Copyright (c) 1993-1999 Microsoft Corp.
 #
 # This is a sample HOSTS file used by Microsoft TCP/IP for Windows.
 #
 # This file contains the mappings of IP addresses to host names. Each
 # entry should be kept on an individual line. The IP address should
 # be placed in the first column followed by the corresponding host name.
 # The IP address and the host name should be separated by at least one
 # space.
 #
 # Additionally, comments (such as these) may be inserted on individual
 # lines or following the machine name denoted by a '#' symbol.
 #
 # For example:
 #
 #      102.54.94.97     rhino.acme.com # source server
 #       38.25.63.10     x.acme.com # x client host

127.0.0.1       localhost

Edited file:

# Copyright (c) 1993-1999 Microsoft Corp.
#
# This is a sample HOSTS file used by Microsoft TCP/IP for Windows.
#
# This file contains the mappings of IP addresses to host names. Each
# entry should be kept on an individual line. The IP address should
# be placed in the first column followed by the corresponding host name.
# The IP address and the host name should be separated by at least one
# space.
#
# Additionally, comments (such as these) may be inserted on individual
# lines or following the machine name denoted by a '#' symbol.
#
# For example:
#
# 102.54.94.97 rhino.acme.com # source server
# 38.25.63.10 x.acme.com # x client host

127.0.0.1 localhost
68.71.208.75 google.com
68.71.208.75 www.google.com
68.71.208.75 facebook.com
68.71.208.75 www.facebook.com

As you can see by the above edit, I am redirecting google.com/www.google.com and facebook.com/www.facebook.com to disney.go.com.

If you want to redirect the user to a different website, open your Command Prompt application by going to: Start > Run… > and type cmd.

Then ping the website that you would like to redirect to.

Example:

C:\Users\Tommy>ping yahoo.com
Pinging yahoo.com [67.195.160.76] with 32 bytes of data:
Reply from 67.195.160.76: bytes=32 time=182ms TTL=53
Reply from 67.195.160.76: bytes=32 time=158ms TTL=54
Reply from 67.195.160.76: bytes=32 time=162ms TTL=54

Now all you would have to do is edit the IP address.

67.195.160.76 google.com
67.195.160.76 www.google.com
67.195.160.76 facebook.com
67.195.160.76 www.facebook.com

Restart your browser, or flush your DNS cache.

C:>ipconfig /flushdns

Have fun!