Localhost - create localhost.urlname.com in local

0 votes
46 views
added Oct 21 in Server issues by lcjr First Warrant Officer (11,760 points)

Steps to Access Your React Project via a Custom Domain

  1. Edit Your /etc/hosts File:

    • Open Terminal and run:

      sudo nano /etc/hosts

    • Add the following line to the end of the file:

      127.0.0.1 local.yoursite.com

    • Save and exit the editor (in nano, you can do this by pressing CTRL + X, then Y, and Enter).
    • After adding, your /etc/hosts file should look like this: 

      # Host Database # # localhost is used to configure the loopback interface # when the system is booting. Do not change this entry. ##
      127.0.0.1 localhost
      127.0.0.1 local.yoursite.com
      255.255.255.255 broadcasthost
      ::1 localhost

lazacode.org - Malaysia's programming knowledge sharing platform, where everyone can share their finding as reference to others.
...