Jump to content

Recommended Posts

Posted

If I put an index.html file in my cgi-bin, I can call it with my browser.

 

But if I put a test.txt file in cgi-bin, the request returns a 500 Internal Server Error.

 

If I put test.txt in any other folder, I can request it successfully.

 

Are the handlers specially configured for cgi-bin such that there isn't one defined for .txt?

 

The "problem" was solved by putting the file somewhere else. I'm just trying to understand why it happened.

Posted

Why would you want to put txt files in the cgi-bin folder? That folder is used primarily for scripts that are executable. I'd make a separate folder for txt files you want to serve in a browser.

Posted

It's not quite as strange as it sounds.

 

The perl script has a .txt data file that it reads. It's a list of words that the script will consider "trivial" when it encounters them.

 

I thought people using the script might be interested to know which words are in that list, so on my web page (not in cgi-bin) that discusses the script, I put a hyperlink to the text file. Clicking on that link is what causes the "500" errors.

 

However, the easy solution was to move the .txt file out of cgi-bin into the same directory as the web page, and revise the script to read the file from its new location instead of from cgi-bin.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...