I have set up a web application on I am running it on my localhost. That is - http://127.0.0.1:8000/. I have set up sub-domains as well. For example, going to http://blog.12
Edit the file /etc/hosts
, add the following line:
127.0.0.1 example.com blog.example.com
Then try http://example.com:8000/ and http://blog.example.com:8000/
Must be adding to file /etc/hosts
127.0.0.1 localhost blog.localhost lvh.me blog.lvh.me
Example for Vim editor (small overview about work in Vim)
Run to edit file /etc/hosts
:
sudo vim /etc/hosts
In Vim press on keyboard button i to switch on edit mode
Add this line:
127.0.0.1 localhost blog.localhost lvh.me blog.lvh.me
Save file:
Press button Esc and after press together buttons shift :
Now you will see line in which write x
and press Enter
Thats all, blog.localhost
and blog.lvh.me
is already available for all ports that you are using.