LiveCodeServer: redirecting with 'put header'

Alex Tweedly alex at tweedly.net
Thu Dec 8 18:31:23 EST 2011


The clue is in the "Internal Server Error" (presumably error 500).

RevServer gives that at various time, including any time a script 
produces no output. It seems that any headers output by "put header" 
don't count as being output :-(

So if I copy/paste your script *exactly* to my on-rev account, I also 
get the Internal Server Error; but if I add a line - even a blank line - 
at the end of the script (which will therefore be a line of 'html' to be 
output) then it no longer gives the error, and the redirect works as 
expected.  (on-rev + Mac OS + Chrome)

-- Alex.


On 08/12/2011 00:39, Matthias Rebbe wrote:
> Hi,
>
> i am trying to redirect to another URL
>
> with
>
> <?lc
> put "http://www.google.com" into tURL
> put  header "Status: 301"
> put header "Location:"&&  tURL
> ?>
>
> I tried it with 'put new header' also. I always get an Internal Server error.
>
> Does anyone know, how i can redirect with  'put header'?
>
> Tried it now with LiveCodeSerer 3.5, 4.64 and 5.0.
>
> Any suggestions?
>
> Regards,
>
> Matthias
>
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>





More information about the Use-livecode mailing list