Editing hosts file to redirect url?
问题 I know you can edit a hosts file to redirect a URL to an IP address as so: 127.0.0.1 google.com but how do you force a redirect to a URL instead of an IP address? e.g. mysite.com/welcome.aspx google.com The explicit URL doesn't work and assuming mysite.com's IP is 222.222.222.222, the following doesn't work either: 222.222.222.222/welcome.aspx google.com 回答1: You can't. A redirect requires a webserver to accept the first request and send back the redirect. The "hosts" file just lets you set