Will
Will

Reputation: 8631

How to redirect a website

Within the /etc/hosts file you can block traffic via

##
# Host Database
#
# localhost is used to configure the loopback interface
# when the system is booting.  Do not change this entry.
##
127.0.0.1       localhost
255.255.255.255 broadcasthost
::1             localhost 
fe80::1%lo0     localhost

# Block Adobe Activation
127.0.0.1       activate.adobe.com
127.0.0.1       practivate.adobe.com
127.0.0.1       ereg.adobe.com
127.0.0.1       activate.wip3.adobe.com
127.0.0.1       wip3.adobe.com
127.0.0.1       3dns-3.adobe.com
127.0.0.1       3dns-2.adobe.com
127.0.0.1       adobe-dns.adobe.com
127.0.0.1       adobe-dns-2.adobe.com
127.0.0.1       adobe-dns-3.adobe.com
127.0.0.1       ereg.wip3.adobe.com
127.0.0.1       activate-sea.adobe.com
127.0.0.1       wwis-dubc1-vip60.adobe.com
127.0.0.1       activate-sjc0.adobe.com
127.0.0.1       hl2rcv.adobe.com
#127.0.0.1      reddit.com
#127.0.0.1      www.reddit.com

However I want to redirect these websites to another website I have online informing the user this is blocked content

Upvotes: 0

Views: 5365

Answers (2)

Mikulas Dite
Mikulas Dite

Reputation: 7941

You cannot redirect to a website per se - the only think you can try is to get the ip address the website is hosted on and if the server is set to handle the request, it will work. That means it's not going to work on shared servers that has one IP.

For more sophisticated redirect, you have to use other solution.

Upvotes: 2

Eugen Rieck
Eugen Rieck

Reputation: 65274

Instead of setting those IPs to 127.0.0.1 set them to the IP of the "Sorry, blocked" server

Upvotes: 1

Related Questions