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

Advertisements

3 Comments »

  1. Very useful post. Thanks!

    Comment by Selvakumar — November 17, 2011 @ 2:33 pm

    • Thanks Selva and also for re-sharing this.

      Comment by Veerasundaravel — November 17, 2011 @ 2:37 pm

  2. Nuttige informatie, hier kan ik erg veel mee bedankt!

    Comment by Laverne Hint — November 25, 2011 @ 9:42 am


RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: