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

I want to redirect "" to a specific IP, using Windows hosts file. Not just the domain but the domain + sub directory.

share|improve this question
you want to redirect it for your local machine (outgoing) or for all? – Raystafarian Jul 24 '13 at 14:01
If you add the domain to the hosts file, the GET request (including the entire URL, including the subdir) will be passed to the server at the IP address. Is something not working? – Paul Jul 24 '13 at 14:05

You can't; as with any DNS resolver, entries in the hosts file can only map an IP address to a domain, and attempting to include a directory path will result in an unreadable entry which will probably be ignored.

What you can do is use an HTTP server, such as Apache, to implement the redirect; in Apache this can be done by means of a Redirect directive in the <Directory> configuration entry for the directory in question, or possibly by means of ProxyPass or ProxyReverse directives if you want the redirect to be transparent.

share|improve this answer

Your Answer


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

Not the answer you're looking for? Browse other questions tagged or ask your own question.