mirror of
https://github.com/jbranchaud/til
synced 2026-01-02 22:58:01 +00:00
Add Map A Domain To localhost as a unix til
This commit is contained in:
@@ -7,7 +7,7 @@ variety of languages and technologies. These are things that don't really
|
||||
warrant a full blog post. These are mostly things I learn by pairing with
|
||||
smart people at [Hashrocket](http://hashrocket.com/).
|
||||
|
||||
_477 TILs and counting..._
|
||||
_478 TILs and counting..._
|
||||
|
||||
---
|
||||
|
||||
@@ -433,6 +433,7 @@ _477 TILs and counting..._
|
||||
- [List Names Of Files With Matches](unix/list-names-of-files-with-matches.md)
|
||||
- [List Of Sessions To A Machine](unix/list-of-sessions-to-a-machine.md)
|
||||
- [List Parent pid With ps](unix/list-parent-pid-with-ps.md)
|
||||
- [Map A Domain To localhost](unix/map-a-domain-to-localhost.md)
|
||||
- [Only Show The Matches](unix/only-show-the-matches.md)
|
||||
- [Open The Current Command In An Editor](unix/open-the-current-command-in-an-editor.md)
|
||||
- [Partial String Matching In Bash Scripts](unix/partial-string-matching-in-bash-scripts.md)
|
||||
|
||||
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