Knowledge base
1000 FAQs, 500 tutorials and explanatory videos. Here, there are only solutions!
HTTP cURL request to obtain the site status
A PING command to your www.your-domain.here will not show whether the site is online or not, but only which IP the site is linked to (whether it is A or CNAME).
In order to be sure that the site is online, a HTTP request must be made, for example:
$ curl -s -o /dev/null -w '%{http_code}' 'http://www.votre-domaine.ici'; echo
200
$ curl -s -o /dev/null -w '%{http_code}' http://test.votre-domaine.ici; echo
000
$
Also check out the cURL documents at the address https://curl.haxx.se/docs/httpscripting.html
Link to this FAQ: