ad_robot_filter

one of the documented procedures in this installation of the ACS
Usage:
ad_robot_filter   conn   args   why
What it does:
A filter to redirect any recognized robot to a specified page
Defined in: /web/philip/tcl/ad-robot-defs.tcl

Source code:


    set useragent [ns_set get [ns_conn headers] "User-Agent"]

    if [robot_p $useragent] {
	set robot_redirect_url [ad_parameter RedirectURL robot-detection]
	# Be sure to avoid an infinite loop of redirects. (Actually, browsers
	# won't look infinitely; rather, they appear to abort after a URL
	# redirects to itself.)
	if { [string first $robot_redirect_url [ns_conn url]] != 0 } {
	    # requested URL does not start with robot redirect URL (usually a dir)
	    ns_log Notice "Robot being bounced by ad_robot_filter: User-Agent = $useragent"
	    ad_returnredirect $robot_redirect_url
	    set result "filter_return"
	} else {
	    # we've got a robot but he is happily in robot heaven
	    set result "filter_ok"
	}
    } else {
	set result "filter_ok"
    }

    return $result


philg@mit.edu