1

I'm developing a new website that will have the same domain name as the current old one, but a different host. The new one doesn't have DNS nameservers pointed to it yet, but I edited the hosts file on my computer to be able to access it. Is there a way I can now still access the old current one on the same computer, since it would help me with development, without changing the hosts file everytime?

Thanks :)

Jojo
  • 25
  • 3

2 Answers2

0

You can check the old site by using the temporary URL

http://server_ip/~cpanelusername/

but many of host block ip preview. You also can use archive.org. You can save the old site before starting new.

For this type scenario, I use a subdomain to built a new site.

 www.mysite.com >> www.dev.mysite.com
Earid
  • 743
  • 4
  • 12
  • 17
0

If possible, it can be helpful to set up an alias and then create an A record for that alias that points to the new site. This allows you to reach the new site via a different name but it will still look at all the files and database(s) as it would normally.

This is helpful for when you want to test the new site before it goes live without having to comment and uncomment the hosts file continuously.

One thing to watch out for is that any URLs that are the full URL such as example.com/whatever instead of /whatever won't work. However, as it is generally bad practise to do the full URL in case the domain ever changes; this can be a good way of finding and corrected any.

Ember
  • 286
  • 3
  • 11