Check URLs for error codes
Published: , Updated:
Topics: quality assurance, unix
I sometimes have a list of URLs and want to check their status code. One use case are updates of a TYPO3 system where I want to check that all the detail pages (e.g. products, authors, etc.) are working. The web server would return a 200 response in case everything is fine, and a 500 in case of issues.
This short code snippet will check a list of URLs from a file and return all the URLs with their status code. That way you can extend the snippet to filter for 500 status codes and retrieve a filtered list of broken URLs.