on-rev redirect

Alex Tweedly alex at tweedly.net
Mon Jan 17 19:19:04 EST 2011


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).

-- Alex.


On 17/01/2011 23:48, Sarah Reichelt wrote:
> On Tue, Jan 18, 2011 at 8:40 AM, Martin Koob<mkoob at rogers.com>  wrote:
>> I have an on-rev page that redirects to another page.
>>
>>   It does that by setting the location header with the 'put header'
>> command which is documented in the on-rev engine notes
>> http://samples.on-rev.com/irev-engine-notes.txt
>>
>> The redirect page does load but the address in the browser is the
>> referring page and a POST from that page is posted to the
>> referring page and not to the redirected page.
>>
>> Is there something else that has to be done to get the page
>> redirected to as the target of a POST command?
>
> Here is what I use Martin, and it changes the URL in the address bar:
>
>           put "http://www.troz.net/onrev/samples/mobile.irev" into tMobilePage
>           put new header "Status: 301 Moved Permanently"
>           put new header "Location:"&&  tMobilePage
>
> This is from<http://www.troz.net/onrev/samples/desktop.irev>
> and if the page detects a mobile device, it automatically redirects
> using the script above.
>
> I wonder does the Status line make a difference, or is it because I
> use "put new header"?
> It's been a while since I set this up, so I can't remember now.
>
> Cheers,
> Sarah
>
> _______________________________________________
> 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