mirror of
https://github.com/jbranchaud/til
synced 2026-01-05 08:08:02 +00:00
Add Map A Domain To localhost as a unix til
This commit is contained in:
15
unix/map-a-domain-to-localhost.md
Normal file
15
unix/map-a-domain-to-localhost.md
Normal file
@@ -0,0 +1,15 @@
|
||||
# Map A Domain To localhost
|
||||
|
||||
Do you want your computer to treat a domain as `localhost`? You can map it
|
||||
as such in your `/etc/hosts` file. For example, if I have an web app that
|
||||
refers to itself with the `dev.app.com` domain, I can add the following line
|
||||
to my `/etc/hosts` file to make sure the domain resolves to `localhost`:
|
||||
|
||||
```
|
||||
127.0.0.1 dev.app.com
|
||||
```
|
||||
|
||||
Now, if I pop open my browser and visit `dev.app.com:3000`, I will see
|
||||
whatever is being served to `localhost:3000`.
|
||||
|
||||
h/t Chris Erin
|
||||
Reference in New Issue
Block a user