Veerasundaravel's Ruby on Rails Weblog

November 13, 2011

Localhost alternates for subdomain

Filed under: Ruby On Rails — Tags: , , , , , , , , — Veerasundaravel @ 2:04 am

Most of we Rails developers, used to check our Rails app using http://localhost:3000/. But this particular url have the  following issues.

1. We can’t add/check subdomain with localhost like http://company1.localhost:3000/

2. Some of external API will not work when we are using localhost.

3. More over using system hostname for subdomain also requires too much configuration in host files.

Best way to solve this:

smackaho.st and lvh.me provides good option of using localhost with subdomain etc. The two domains are pointed to localhost only. If we go to http://lvh.me:3000/ we’ll see the homepage of our application because lvh.me resolves to the IP address 127.0.0.1.

Checkout all the below urls. all will open your application homepage.

http://smackaho.st:3000/
http://abc.smackaho.st:3000/
http://lvh.me:3000/
http://xyz.lvh.me:3000/


Related Articles:

tbaggery – Smack a Ho.st
ASCIIcasts – Subdomain in Rails3

The Silver is the New Black Theme. Blog at WordPress.com.

Follow

Get every new post delivered to your Inbox.

Join 120 other followers

%d bloggers like this: