on-rev redirect

Martin Koob mkoob at rogers.com
Mon Jan 17 20:23:22 EST 2011

Alex Tweedly <alex at ...> writes:

> It's the 'status 301' line that does it. Setting a location is not, in 
> general, enough.
> http://en.wikipedia.org/wiki/URL_redirection says
> >
> > Sometimes, it is sufficient to print the "Location: 'url'" header line 
> > from a normal CGI script. Many web servers choose one of the 3xx 
> > status codes for such replies.
> >
> >
> but you should use a status of 301 (permanent redirection) for the 
> proper effect (302 - temporary redirection - is probably not what you 
> want,  most browsers will display the redirected page, but the 
> non-redirected URL).

Thanks Sarah and Alex.  I tried using different combinations of the Status 301
line and the 'put new header' command.  It is the Status 301 line that makes
 the difference.  Using Sarah's example

         put header "Status: 301 Moved Permanently"
         put header "Location:" && tMobilePage

works equally well as

         put new header "Status: 301 Moved Permanently"
         put new header "Location:" && tMobilePage

So 'new' does not seem to make a difference here.  Is there a 
situation where the 'new' would be required?

Thanks again


More information about the Use-livecode mailing list