Accessing a site by IP address?

I'm trying to work out how I can access a site by IP address so that I can publish a replacement site to a new hosting set up, check it out by accessing it by IP address only, before asking my client to re-point his domain name to his new hosting.

To test this out I've tried accessing my test site by IP and found some instructions online on how to change the hosts file which I have found and modified through Terminal. I then reboot but it doesn't let me access the site. I get a message 'This is the deafult server Vhost' every time.

I'm on an M1 Mac running Monterey 12.2.1 Any ideas or a better way to seamlessly go live with a new site on an existing domain?

3 replies