0

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

4
  • Correction: hosts file does not support URL to anything. It only works with "host to ip" kind of redirections. Aug 12, 2012 at 14:16
  • oh, yes, I need exactly url to ip.
    – scythargon
    Aug 12, 2012 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, 2012 at 16:25
  • damn, URL TO URL! site1.com/url1 to site1.com/url2
    – scythargon
    Aug 14, 2012 at 10:21

1 Answer 1

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

1
  • 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.
    – user79032
    Jun 30, 2013 at 3:25

You must log in to answer this question.

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