Hi,
i need a help to redirect my website.
i have hosted my site in 2 servers. form first server i just redirect the site to second server using php header code i.e.:
header("Location: http://www.mydomain.com/secondserver/index.php");
now sometimes my second server goes down. For this time period i want to locate the site to first server.
In my word i can say this way:
Task to do from first server
1. check if second server running or not. if running then redirect the page to second server.
2. if second server not running then locate the url to first server
please help!
thanks in advance
If URL not exists then redirect to another URL
Moderator: General Moderators
-
jamiel
- Forum Contributor
- Posts: 276
- Joined: Wed Feb 22, 2006 5:17 am
- Location: London, United Kingdom
Use the cURL extensions if you have can't retrieve urls using file_get_contents() . Can cache a working copy of a test page, then curl it and see if its changed or if it times out.