Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

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

hosts file does not support url to url syntax, only url to ip. Ubuntu 12.04

share|improve this question
Correction: hosts file does not support URL to anything. It only works with "host to ip" kind of redirections. – grawity Aug 12 '12 at 14:16
oh, yes, I need exactly url to ip. – scythargon Aug 12 '12 at 16:14
For url-to-ip you should think about DNS; 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. – nik Aug 12 '12 at 16:25
damn, URL TO URL! to – scythargon Aug 14 '12 at 10:21
up vote 1 down vote accepted
  1. Setup local web server (Apache would be fine).

  2. Use host file to point URL to local IP.

  3. 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.

share|improve this answer
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. – Evil Angel Jun 30 '13 at 3:25

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .