Rev server: going to another .irev page from script
Jim Ault
jimaultwins at yahoo.com
Sat Feb 12 13:06:34 EST 2011
On Feb 12, 2011, at 8:53 AM, stephen barncard wrote:
> wow this list is wonderful. thanks all -- more than one way to do
> this...
>
> Andre - does this method require a full path?
It requires a web page URL
pLocation should be like "http://www.mysite.com/myfile.irev"
This would be the way to load a new web page in the browser.
The browser history would update so the user could 'go back'
The issue with Apache web servers is that the 'Status' header needs to
be sent first to the browser or the header 'Location' is ignored.
You could also use the following
get "Status:301"
get IT & cr & "Location:"
get IT && "http://www.mysite.com/myfile.irev"
put IT -- send both lines to the browser at once
or
get "Status:301" & cr & "Location: http://www.mysite.com/
myfile.irev"
put IT -- send both lines to the browser at once
Hope this helps.
Jim Ault
Las Vegas
>
> On 12 February 2011 08:26, Andre Garzia <andre at andregarzia.com> wrote:
>
>> Stephen,
>>
>> Use this:
>>
>> on redirect pLocation, pCode
>> if pCode is empty then put "301" into pCode
>>
>> put header "Status:" && pCode # <-- Apache needs that, so I've
>> learned
>> put header "Location:" && pLocation
>> put "redirecting"
>> quit
>> end redirect
>>
>>
>> call it like:
>>
>> redirect "http://www.mysite.com/myfile.irev"
>>
>> (this snippet is from RevSpark minimal framework,
>> http://hg.andregarzia.com/revspark )
>>
>> :-D
>>
More information about the use-livecode
mailing list