How do I redirect a URL to another URL in the hosts file, rather than redirecting an IP to a URL?

chad picture chad · Jul 19, 2010 · Viewed 18.2k times · Source

How do I redirect a URL to another URL in the hosts file, rather than redirecting an IP to a URL?

Answer

Jim Lewis picture Jim Lewis · Jul 19, 2010

You can't. DNS (or the host files) lets you look up IP addresses for a given host name. There is no concept of remapping URLs at this level of networking. This needs to be done in your web server configuration.