# tell AOLserver to send a GET request for any URL # to a Tcl procedure ns_register_proc GET / random_main # here's the procedure, note that it can present an entire hierarchy of # normally linked HTML pages to search engines. But a user whose # browser doesn't supply a user-agent header that is on the list of # known search engines will get redirected. proc random_main {conn ignore} { set user_agent [util_GetUserAgentHeader] # we put these in lower case and then do a -nocase search set spider_names [list architext infoseek lycos webcrawler spidey scooter altavista slurp] foreach spider $spider_names { if { [regexp -nocase $spider $user_agent] } { # we have a spider! ns_log Notice "Random server delivering to spider: $user_agent; request was [ns_conn url]" set requested_file "[ns_info pageroot][ns_conn url]" if { [ns_conn url] != "/" && [file exists $requested_file] } { ns_returnfile 200 text/html $requested_file } else { ns_returnfile 200 text/html "[ns_info pageroot]/index.html" } # quit the procedure; our work is done return } } # McQuinn Property Ltd.,Estate Agents, Tralee, Co.Kerry # Auctioneers, Valuers, Ireland, Houses, Rent, # Short Term, Long Term , Let, Letting, For sale, # Auction,auctions, Apartments, Commercial, Property,properties, # Firhouse, Valuation, Letting Agents, Renting, # Accommodation, Homes, home, Houses,house,site, Sites,lands, Land,offices,lettings, Office space, Ireland ns_returnredirect "http://www.mcquinnproperty.com"