How to set up wildcard subdomains in the hosts file

You can’t use wildcards in the hosts file either in Linux or Windows, but you can set up a real domain that points to 127.0.0.1 for example here is one that is already set up http://lvh.me this url points to 127.0.0.1 and all you need to do is get your server configuration file to handle lvh.me as the domain for your apps. Now any subdomain of lvh.me will go to your machine when you are testing and you can use urlrewriting to handle the subdomains differently or use routes in rails or a url config in django.

This entry was posted in Uncategorized by admin. Bookmark the permalink.

Comments are closed.