I'm moving a site to a new address and I want to create a redirect page on the old site.
Just out of pure curiosity to see if it's possible is there any way I can get some PHP to check if the domain is resolved, and if it is redirect to the new domain name, otherwise, redirect to a different address (the IP that works before domain resolves).
I've moved my files too since I switched host at the same time so visitors do need to be redirected.
Is this possible? Check domain resolved -> if true { redirect to domain } else { redirect to IP } kinda thing....
Like I say, just out of curiosity and for future reference.
Thanks