iammerlijn online

Rails subdomains with lvh.me

localhost does not behave like a real domain for subdomain testing, so Rails routes such as app.example.com are awkward to test locally.

lvh.me solves that by resolving to 127.0.0.1, which means you can use real-looking local subdomains like:

  • app.lvh.me:3000
  • admin.lvh.me:3000

That makes it much easier to test Rails subdomain routing locally without editing /etc/hosts.