[SOLVED] Setting up host file to redirect foo.com to localhost:3000


I’m trying to test out some Facebook features on my rails application and I would like to use a host file to redirect my foo.com to localhost:3000 when developing.

Here’s what I’ve added to my private/etc/hosts file: foo.com

Then I flushed my DNS cache:

dscacheutil -flushcache

Yet I still can’t access my local rails application using foo.com. Any suggestions?


I think you shouldn’t set port at hosts file. Port would be setup by rails rails server -p 3000

Answered By – Abbasov Alexander

Answer Checked By – Pedro (BugsFixing Volunteer)

Leave a Reply

Your email address will not be published.