How do I check for valid (not dead) links programmatically using PHP?

后端 未结 9 1796
独厮守ぢ
独厮守ぢ 2020-12-08 08:24

Given a list of urls, I would like to check that each url:

  • Returns a 200 OK status code
  • Returns a response within X amount of time

The

9条回答
  •  盖世英雄少女心
    2020-12-08 09:12

    You only need a bash script to do this. Please check my answer on a similar post here. It is a one-liner that reuses HTTP connections to dramatically improve speed, retries n times for temporary errors and follows redirects.

提交回复
热议问题