Put Header Used for Redirects

Are you using LiveCode to create server scripts or CGIs?

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
Siddhanathaswami
Posts: 2
Joined: Fri Sep 05, 2014 2:52 am

Put Header Used for Redirects

Post by Siddhanathaswami » Sun Nov 30, 2014 11:38 pm

Aloha,

I'm having a strange issue with redirects and http headers on a Ubuntu 14 server running Apache 2.4 and LiveCode 6.7 Community Server.

This just returns an "Internal Server Error" when in a file such as redirecttest.lc:

<?lc
put header "Status: 301 Moved Permanently"
put header "Location: /index.shtml"
?>

I don't think it's an error in server config as I have something almost identical working elsewhere on the same server.

Any ideas?

matthiasr
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 190
Joined: Sat Apr 08, 2006 7:55 am
Location: Lübbecke, Germany
Contact:

Re: Put Header Used for Redirects

Post by matthiasr » Wed Dec 03, 2014 1:07 am

Hi,

just add another put statement at the end of the script.

For example

Code: Select all

<?lc
put header "Status: 301 Moved Permanently"
put header "Location: /index.shtml"
put ""
?>
That should do.

HTH

Matthias

Post Reply

Return to “CGIs and the Server”