Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 79837
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T21:12:30+00:00 2026-05-10T21:12:30+00:00

I am trying to get a header that will work with Apache, IIS 6,

  • 0

I am trying to get a header that will work with Apache, IIS 6, and IIS 7. I won’t go into the reason for that here. Let’s just say that it’s not as easy as I thought it would be 🙂

Anyway, the problem has something to do with NPH. In our code (originally written for IIS 6) we have

use CGI qw(:standard);  print 'HTTP/1.0 200 OK\n';  print header; 

at the top of every cgi script; I read that this is how you tell IIS that you want NPH.

Apache uses the filename to see if the output is nph (nph- must be the beginning of the filename) so what I did (which works in both IIS 6 and Apache) is the following:

use CGI qw(:standard); print header('text/html', '200 OK'); 

IIS 7, interestingly, seems to require NPH, so if I don’t either do

use CGI qw(:standard -nph); 

or

print 'HTTP/1.0 200 OK\n';  print header('text/html', '200 OK'); #parameters are apparently optional  

the browser tries to do something weird with the file, since it doesn’t get the mimetype.

Also note: IIS 6 and 7 are ok without printing any header at all, but Apache doesn’t like that.

Anyway, the best thing right now would be to make

use CGI qw(:standard); print header('text/html', '200 OK'); 

somehow work in IIS 7. Does anyone know how I can do that? I don’t know all the details for our server configuration, but if you tell me how to get any details you might need, I can do that.

Thanks either way!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-10T21:12:31+00:00Added an answer on May 10, 2026 at 9:12 pm

    Brian (and others) have told me to write a subroutine that would Do The Right Thing. Hope this helps someone else!

    sub header {     return (($ENV{PERLXS})?'HTTP/1.0 200 OK\r\n':'').CGI->header(@_); } 
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 88k
  • Answers 89k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Try trimming l and then comparing it. http://www.somacon.com/p355.php May 11, 2026 at 5:48 pm
  • Editorial Team
    Editorial Team added an answer If it is reasonable to outsource to the OS, that… May 11, 2026 at 5:48 pm
  • Editorial Team
    Editorial Team added an answer SELECT * FROM some_table WHERE ID IN ('1001', '1002', '1003')… May 11, 2026 at 5:48 pm

Related Questions

I am looking for a regex statement that will let me extract the HTML
I have some HTML I am trying to parse. There are cases where the
I'm trying follow a tutorial to create a custom USB driver in Linux and
I am trying to create a recordset in Access VBA that will show me

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.