im new to react.js
I want to know how can i have multiple subdomains in react Like subdomain.localhost:3000
I tried some tutorials ,when they type subdomain.localhost.com
it takes them to default page i.e localhost.com but in my case it is taking me to Invalid host header
.
Does anyone know how to set multiple subdomains in react.
CodePudding user response:
You can use default host file in OS
Hosts file is a local file stored on the computer that translates domain names or NetBIOS names into an IP addresses.
in window you can find in
drive:\Windows\System32\drivers\etc
Problem Solve by adding
DANGEROUSLY_DISABLE_HOST_CHECK=true
in .env file of React Js
CodePudding user response:
One way would be to edit your hosts file on your OS to reflect this. 127.0.0.1 www.domain.com 127.0.0.1 domain.com