From: JamesBritt Date: 2002-09-16T06:09:21+09:00 Subject: RE: ruby HTTP redirect? Hi, > > > I'm new to Ruby, only used Perl and PHP before. Welcome! > > I know there is no method "header" (as in PHP) or "redirect" in Ruby's CGI > class, but I need to know how to do HTTP redirects in Ruby. > > Any suggestions? The raw text way: def redirect( new_page ) print "HTTP/1.1 302 OK\r\n" print "Location:#{new_page}\n\n" end The CGI way (off the top of my head) cgi = CGI.new("html4") cgi.header("Location" => "/some/other/page") James > > > > Thanks in advance! >