How can I change the Content-Type of Perl-CGI scripts?

Discussion in 'Perl Misc' started by Thomas Armstrong, Nov 12, 2007.

  1. Hi.

    Working with Apache 2.0 (on a customer's server and on my own server),
    I've got a '500 Internal Server Error' with a CGI application. When
    accessing 'http://customer_machine/test.cgi', Firefox tries to
    download the error webpage.

    But when accessing 'http://my_own_machine/test.cgi', Firefox shows the
    HTML error webpage.

    Analyzing headers

    ---------------------------------------
    http://customer_machine/test.cgi
    HTTP/1.1 500 Internal Server Error
    Content-Type: application/x-cgi
    ----------------------------------------

    --------------------------------------
    http://my_own_machine/test.cgi
    HTTP/1.1 500 Internal Server Error
    Content-Type: text/html; charset=iso-8859-1
    --------------------------------------

    How can I change the Content-Type of CGI scripts?

    Thank you very much.
     
    Thomas Armstrong, Nov 12, 2007
    #1
    1. Advertising

  2. Thomas Armstrong wrote:
    > How can I change the Content-Type of CGI scripts?


    Just a very wild guess: maybe by changing the parameter(s) of the header()
    method?

    jue
     
    Jürgen Exner, Nov 12, 2007
    #2
    1. Advertising

  3. Thomas Armstrong

    Ron Bergin Guest

    On Nov 12, 9:41 am, Thomas Armstrong <> wrote:
    > Hi.
    >
    > Working with Apache 2.0 (on a customer's server and on my own server),
    > I've got a '500 Internal Server Error' with a CGI application. When
    > accessing 'http://customer_machine/test.cgi', Firefox tries to
    > download the error webpage.
    >
    > But when accessing 'http://my_own_machine/test.cgi', Firefox shows the
    > HTML error webpage.
    >
    > Analyzing headers
    >
    > ---------------------------------------http://customer_machine/test.cgi
    > HTTP/1.1 500 Internal Server Error
    > Content-Type: application/x-cgi
    > ----------------------------------------
    >
    > --------------------------------------http://my_own_machine/test.cgi
    > HTTP/1.1 500 Internal Server Error
    > Content-Type: text/html; charset=iso-8859-1
    > --------------------------------------
    >
    > How can I change the Content-Type of CGI scripts?


    Well, that depends on whether you're referring to the headers your cgi
    script outputs or the headers of the web server's error page that was
    returned.
     
    Ron Bergin, Nov 12, 2007
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Stanimir Stamenkov
    Replies:
    2
    Views:
    794
    Stanimir Stamenkov
    Oct 25, 2005
  2. davidj411
    Replies:
    0
    Views:
    583
    davidj411
    Jun 27, 2008
  3. James
    Replies:
    1
    Views:
    155
    Nigel Horne
    Aug 4, 2003
  4. BestFriend
    Replies:
    2
    Views:
    919
  5. Replies:
    13
    Views:
    581
    Anno Siegel
    Sep 10, 2007
Loading...

Share This Page