The syntax stays mostly the same across in Windows, macOS, or Linux. Generally, most hosts files will have several entries for loopback. Follow the below basic syntax of a host entry.
An entry is divided into 3 parts in following way.
- The location to redirect the address to
- The address that you will want to redirect,
- The comment.
Follow below instructions if you are running on WIndows 10 or 8:
- Run NotePad or NotePad++ as Administrator.
- Open the following file: c:\Windows\System32\Drivers\etc\hosts
- Make the necessary changes to the file.
- Go to File > Save your changes.
Sample host file entry for http://localhost/UmbracoDemoApp/
127.0.0.1 UmbracoDemoApp # Sample host name 127.0.0.1 UmbracoDemoApp.local # Sample host name