LiveCodeServer: redirecting with 'put header'

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

LiveCodeServer: redirecting with 'put header'

Matthias Rebbe | M-R-D
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
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: LiveCodeServer: redirecting with 'put header'

Pierre Sahores-2
Hi,

get "<?xml version=" & setquote("1.0") && "encoding=" & setquote("UTF-8") & "?>" & return & \
            "<!DOCTYPE html>" & return & "<html xmlns=" & setquote("http://www.w3.org/1999/xhtml") & ">" & return & \
            "<head>" & return & "<meta http-equiv=" & setquote("content-type") && "content=" & setquote("text/html; charset=UTF-8") && "/>" & return & \
            "<meta http-equiv=" & setquote("refresh") && "content=" & setquote("0; url=http://www.exemple.com/") && "/>" & return & \
            "<title>widestep</title>" & return & "<meta name=" & setquote("robots") && "content=" & setquote("all") && "/>" & return & \
            "</head>" & return & "<html><body> </body></html>"
put it

OK with Rev/LC server 3.5 to 5

HTH,

Le 8 déc. 2011 à 01:39, Matthias Rebbe a écrit :

> 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
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode

--
Pierre Sahores
mobile : 06 03 95 77 70
www.sahores-conseil.com




_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: LiveCodeServer: redirecting with 'put header'

Jim Ault
This is a version of the 'get' command that I use
  it requires less characters
   does not require a function call
    it is easier to read for me

Note: in HTML the single and double quotes work the same way,
and space runs count as only one space.

get "<?xml version='1.0' encoding='UTF-8' ?>   rrr" & \
         "<!DOCTYPE html>   rrr<html xmlns='http://www.w3.org/1999/xhtml'>   rrr" &  \
           "<head>   rrr<meta http-equiv='content-type' content='text/html; charset=UTF-8' />   rrr" & \
             "<meta http-equiv='refresh' content='0; url=http://www.exemple.com/' />   rrr" & \
              "<title>widestep</title>   rrr<meta name='robots' content='all' />   rrr" & \
               "</head>   rrr<html><body> </body></html>"

replace "rrr" with CR in IT

Jim Ault


On Dec 7, 2011, at 9:30 PM, Pierre Sahores wrote:

> Hi,
>
> get "<?xml version=" & setquote("1.0") && "encoding=" & setquote("UTF-8") & "?>" & return & \
>            "<!DOCTYPE html>" & return & "<html xmlns=" & setquote("http://www.w3.org/1999/xhtml") & ">" & return & \
>            "<head>" & return & "<meta http-equiv=" & setquote("content-type") && "content=" & setquote("text/html; charset=UTF-8") && "/>" & return & \
>            "<meta http-equiv=" & setquote("refresh") && "content=" & setquote("0; url=http://www.exemple.com/") && "/>" & return & \
>            "<title>widestep</title>" & return & "<meta name=" & setquote("robots") && "content=" & setquote("all") && "/>" & return & \
>            "</head>" & return & "<html><body> </body></html>"
> put it
>
> OK with Rev/LC server 3.5 to 5
>
> HTH,
>
> Le 8 déc. 2011 à 01:39, Matthias Rebbe a écrit :
>
>> 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
>> [hidden email]
>> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode
>
> --
> Pierre Sahores
> mobile : 06 03 95 77 70
> www.sahores-conseil.com
>
>
>
>
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: LiveCodeServer: redirecting with 'put header'

Andre Garzia-3
In reply to this post by Matthias Rebbe | M-R-D
Matthias,

This will sound crazy ok... but try the script with an extra put with
content, like this:

>
> <?lc
> put "http://www.google.com" into tURL
> put  header "Status: 301"
> put header "Location:" && tURL
>
   put "redirecting..."

> ?>


And tell me if it works.

--
http://www.andregarzia.com -- All We Do Is Code.
http://fon.nu -- minimalist url shortening service.
_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: LiveCodeServer: redirecting with 'put header'

Matthias Rebbe | M-R-D
In reply to this post by Jim Ault
Hi,

thank you Piere and Jim,

that works, although it is not very easy to read.


I will use that solution until i found out, why "put header" does not work.

Regards,

Matthias

 
Am 08.12.2011 um 04:17 schrieb Jim Ault:

> This is a version of the 'get' command that I use
>  it requires less characters
>   does not require a function call
>    it is easier to read for me
>
> Note: in HTML the single and double quotes work the same way,
> and space runs count as only one space.
>
> get "<?xml version='1.0' encoding='UTF-8' ?>   rrr" & \
>         "<!DOCTYPE html>   rrr<html xmlns='http://www.w3.org/1999/xhtml'>   rrr" &  \
>           "<head>   rrr<meta http-equiv='content-type' content='text/html; charset=UTF-8' />   rrr" & \
>             "<meta http-equiv='refresh' content='0; url=http://www.exemple.com/' />   rrr" & \
>              "<title>widestep</title>   rrr<meta name='robots' content='all' />   rrr" & \
>               "</head>   rrr<html><body> </body></html>"
>
> replace "rrr" with CR in IT
>
> Jim Ault
>
>
> On Dec 7, 2011, at 9:30 PM, Pierre Sahores wrote:
>
>> Hi,
>>
>> get "<?xml version=" & setquote("1.0") && "encoding=" & setquote("UTF-8") & "?>" & return & \
>>           "<!DOCTYPE html>" & return & "<html xmlns=" & setquote("http://www.w3.org/1999/xhtml") & ">" & return & \
>>           "<head>" & return & "<meta http-equiv=" & setquote("content-type") && "content=" & setquote("text/html; charset=UTF-8") && "/>" & return & \
>>           "<meta http-equiv=" & setquote("refresh") && "content=" & setquote("0; url=http://www.exemple.com/") && "/>" & return & \
>>           "<title>widestep</title>" & return & "<meta name=" & setquote("robots") && "content=" & setquote("all") && "/>" & return & \
>>           "</head>" & return & "<html><body> </body></html>"
>> put it
>>
>> OK with Rev/LC server 3.5 to 5
>>
>> HTH,
>>
>> Le 8 déc. 2011 à 01:39, Matthias Rebbe a écrit :
>>
>>> 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
>>> [hidden email]
>>> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
>>> http://lists.runrev.com/mailman/listinfo/use-livecode
>>
>> --
>> Pierre Sahores
>> mobile : 06 03 95 77 70
>> www.sahores-conseil.com
>>
>>
>>
>>
>> _______________________________________________
>> use-livecode mailing list
>> [hidden email]
>> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode
>
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode


_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: LiveCodeServer: redirecting with 'put header'

Matthias Rebbe | M-R-D
In reply to this post by Andre Garzia-3
Hi Andre.

while answering to the other replies i oversaw your one..
Tried it now out. It works ! ! !

But why do i have to put the "redirecting…"?

Is this an on-rev specific thing or is this additional put also needed when using LiveCodeServer on
other systems? If the 2nd, then RunRev would do right to put that information into the ReleaseNotes.

Anyway, it works. Thank you very much.

Regards,

Matthias


Am 08.12.2011 um 16:26 schrieb Andre Garzia:

> Matthias,
>
> This will sound crazy ok... but try the script with an extra put with
> content, like this:
>
>>
>> <?lc
>> put "http://www.google.com" into tURL
>> put  header "Status: 301"
>> put header "Location:" && tURL
>>
>   put "redirecting..."
>
>> ?>
>
>
> And tell me if it works.
>
> --
> http://www.andregarzia.com -- All We Do Is Code.
> http://fon.nu -- minimalist url shortening service.
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode


_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: LiveCodeServer: redirecting with 'put header'

Andre Garzia-3
Matthias,

I have no answer for that but I noticed that redirections with 301 with
RevServer just work if you output some content as well, any content. I
usually go with "redirecting..." or with a link to where I am redirecting
them.

=)

On Thu, Dec 8, 2011 at 1:50 PM, Matthias Rebbe <
[hidden email]> wrote:

> Hi Andre.
>
> while answering to the other replies i oversaw your one..
> Tried it now out. It works ! ! !
>
> But why do i have to put the "redirecting…"?
>
> Is this an on-rev specific thing or is this additional put also needed
> when using LiveCodeServer on
> other systems? If the 2nd, then RunRev would do right to put that
> information into the ReleaseNotes.
>
> Anyway, it works. Thank you very much.
>
> Regards,
>
> Matthias
>
>
> Am 08.12.2011 um 16:26 schrieb Andre Garzia:
>
> > Matthias,
> >
> > This will sound crazy ok... but try the script with an extra put with
> > content, like this:
> >
> >>
> >> <?lc
> >> put "http://www.google.com" into tURL
> >> put  header "Status: 301"
> >> put header "Location:" && tURL
> >>
> >   put "redirecting..."
> >
> >> ?>
> >
> >
> > And tell me if it works.
> >
> > --
> > http://www.andregarzia.com -- All We Do Is Code.
> > http://fon.nu -- minimalist url shortening service.
> > _______________________________________________
> > use-livecode mailing list
> > [hidden email]
> > Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> > http://lists.runrev.com/mailman/listinfo/use-livecode
>
>
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>



--
http://www.andregarzia.com -- All We Do Is Code.
http://fon.nu -- minimalist url shortening service.
_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: LiveCodeServer: redirecting with 'put header'

Alex Tweedly
In reply to this post by Matthias Rebbe | M-R-D
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
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>


_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: LiveCodeServer: redirecting with 'put header'

J. Landman Gay
On 12/8/11 5:31 PM, Alex Tweedly wrote:
> 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.

So *that's* it. It isn't just Rev server. I found out the hard way that
if an old-style CGI exits to top, you get a 500 error. It took me
forever to figure out what was causing it. I lost hair and said bad words.

--
Jacqueline Landman Gay         |     [hidden email]
HyperActive Software           |     http://www.hyperactivesw.com

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode