Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

What I want: When users type a certain URL, say, or, that they get automatically redirected to another site... say or something.

I am volunteering at my local library setting up some computers and they wanted to "encourage" the kids to visit certain sites over other ones. Ethics aside, I was wondering how I should go about implementing this other than a ban in the hosts.txt file.

PS -- Did I say I was a monster for banning Reddit from kids? Yes yes, sorry again... just think of me preventing kids from making more inane rage comics, novelty accounts, and pun threads to fill the site. ಠ_ಠ

share|improve this question
If you're looking at a Chrome extension here's my answer to a similar question – Sathya Aug 14 '11 at 7:58
up vote 2 down vote accepted

One of the easier way is to use the hosts file, it's easy to circumvent if you know the IP of the site you want to go to. Another option is

share|improve this answer
But: the hosts file will only work if the target site is not on some shared hosting. Like ping might yield, but lacking the HTTP Host: header, http:\\ will take one to Google Search instead: http:\\ (Okay, 6th edit: no IP addresses allowed in links in comments?) – Arjan Aug 14 '11 at 8:32
I couldn't find information about redirecting on OpenDNS. (Even then: it's a nice solution for schools, even more if one can set up something in a router, to outsmart the kids!) – Arjan Aug 14 '11 at 8:37
@Arjan - I'm pretty sure you can redirect a url when you block it. – Nifle Aug 14 '11 at 8:43
Hrm, so does it have to be IP dependent? Say if I want to direct to a specific page instead of just the base site? – binarysolo Aug 14 '11 at 8:44
@Binary - Yes for a quick solution I'm afraid so. – Nifle Aug 14 '11 at 8:49

The simplest way I can think of is to put the hostname in your hosts file with the ip address of the site you want to redirect it to.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .