From: Peter Jones Date: 2008-05-11T02:40:13+09:00 Subject: Re: cgi.header redirect "Haris Bogdanovic" writes: > I tried to redirect a html page to itself to avoid browser's question about > resending post data but it doesn't work. > I tried this: > > cgi=CGI.new > cgi.header('status'=>'302 moved', 'location'=>'my_page.rb') > or > cgi.header('status'=>'REDIRECT', 'location'=>'my_page.rb') > > The browser still asks the question about post data when I click the Refresh > button The browser is doing the right thing. It doesn't matter that the result of a POST was a redirect (which is very common). If you click the refresh button after a POST, the browser will want to redo the POST. It of course asks if you want to POST the same data, which is good (especially if you just posted your credit card number). There are two ways around this, depending on what you are trying to do. If you are just trying to refresh the page by hand without the warning box, click in the location bar and press return. If you want to refresh automatically, without the warning box, add a meta refresh tag to the HTML. -- Peter Jones [pjones at domain below] pmade inc. - http://pmade.com