Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

Please help me to solve this problem. My project manager want that

In address bar if user type predefined strings, After http:// it should redirect to given url

firstly user must type http://localhost/task/htaccess url & then

example if user types

http://one it should redirect to

or http://two redirect to

Please help me to solve it.


share|improve this question

migrated from Apr 3 '11 at 13:46

This question came from our site for pro webmasters.

Assuming you are running Windows:

1) Open up the hosts file which can be found in the C:\Windows\System32\drivers\etc directory

2) Add the following line to the bottom of the file  one

3) Save the file

This needs to be done on every computer you want this to work for. So this means it will only be feasible internally (i.e. your company or internal network). You can't get computers outside your control to do this without having them knowingly install software that does it for them or providing them instructions. If you do this without their knowledge or permission you will be breaking laws.

share|improve this answer
"Internally", this can be done using DNS too. – grawity Apr 3 '11 at 14:37
Very good point. As a web developer this is as much as I know as I use this for internal testing. It allows me to set up domains for each site I am working on. Hopefully someone here can show them how to do this with internal DNS. – John Conde Apr 3 '11 at 15:20

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.