Redirecting to a new URL under mod_ruby
Nick Bicknell <[email protected]>
| Newsgroups | gmane.comp.apache.mod-ruby |
|---|---|
| Message-ID | <[email protected]> |
Hi,
I'm using Ruby 1.8.1 with mod_ruby 1.2 under apache 1.3.2x on Mac os X 10.3.4.
I have a cgi script that looks like this:
#!/usr/bin/ruby
require "cgi"
q = CGI.new
caller_url = q.referer.gsub( /(.*)\?*.*/, '\1' )
# do some work here....
print "Location: #{caller_url}\n\n"
What I am trying to accomplish is to have the cgi script do a little work (e.g., delete a record from the database, or add one, etc.) and to then redirect the browser automatically to a new URL, in this case, the one that called it. The issue is that the above code doesn't seem to work - it just prints the text "Location: http://etc/etc/"
Any advice would be most appreciated.
Thanks,
Nick