I have a page that sends people to another website directing them to a sub-page. The problem is the addresses of these sub-pages change as that site updates or makes changes. So I'd like to check prior to sending them, that the page still exists. If it doesn't exist, I can send them to the other site's homepage. How can I code this in php so that they aren't directed to an empty page (404 error)?