hosts
file does not support url to url syntax, only url to ip.
Ubuntu 12.04
1 Answer
Setup local web server (Apache would be fine).
Use host file to point URL to local IP.
Use Apache's mod_rewrite to rewrite the URL. Or, you can put an index.html file in the DocumentRoot of web server & redirect using JavaScript or HTML meta refresh.
You can also go one step further to install PHP and redirect URL using index.php.
-
For step 3, you can get codes with one Google search (if you don't know how to do that). Or, just ask me for baked codes. At this time, I am on mobile so unable to type codes quickly. Jun 30, 2013 at 3:25
hosts
file does not support URL to anything. It only works with "host to ip" kind of redirections.url-to-ip
you should think aboutDNS
; and now your comment not longer matches your question... url-to-url? url-to-ip? please get your intent clear and then update the question itself.