Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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 google.com

or http://two redirect to google.com

Please help me to solve it.

Thanks

share|improve this question

migrated from webmasters.stackexchange.com Apr 3 '11 at 13:46

This question came from our site for pro webmasters.

1 Answer 1

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

google.com  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
1  
"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

 
discard

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