Ajax software
Free javascripts
↑
Main Page
The
getPath()
method traces the path of a request and sets the second parameter to the final result
code subject to a limit of 10 redirections. You can use this class to audit lists of links around your site
or in a database and remove or flag dead links.
Apart from
getPath()
, the
LinkChecker
class has other useful methods as well, and the
check_
links.php
script uses them all. For example, the
getHeader()
method retrieves the header of the
URL sent as parameter. The result of this can be fed as parameter to
parseResponseCode()
, which
reads the header data and returns the HTTP status code by reading it from the header. Depending on
your requirements, an answer of 200, or a 301 or 302 that eventually leads to a 200 response, may be
acceptable.
Summary
This chapter talked about a few common technical problems that you may encounter when maintaining
your web sites. You’ve learned about the detrimental effects of unreliable web hosting providers (and
how to safely switch!), as well as the dangers of having cross-linked web sites in the same C class. You’ve
explored safe approaches to split-testing. At the end of the chapter you had your share of geek-fun, build-
ing the
LinkChecker
library. This chapter has finished covering all necessary background material. In the
next chapter you build a search engine–optimized cookie catalog. We hope you are hungry!
259
Chapter 13: Coping with Technical Issues
c13.qxd:c13 10:45 259
Ajax software
Free javascripts
→