?
Solved

.htaccess Ignore errordocument Redirects in cgi-bin

Posted on 2012-03-20
3
Medium Priority
?
1,004 Views
Last Modified: 2013-12-25
I have the following code in my .htaccess file:

ErrorDocument 401 /404.htm
ErrorDocument 403 /404.htm
ErrorDocument 404 /404.htm
ErrorDocument 500 /404.htm

I would like those error redirects ignored in my cgi-bin so that if I have CGI it won't redirect to an error page. How can I do this?
0
Comment
Question by:webstuck5
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 51

Expert Comment

by:ahoffmann
ID: 37750179
what should happen for those 40x errors?
what should your webserver return for 500?
0
 

Author Comment

by:webstuck5
ID: 37750262
If I have a CGI script error then I don't want the page to redirect. I want the cgi-bin to ignore the errordocument redirects.
0
 
LVL 51

Accepted Solution

by:
ahoffmann earned 2000 total points
ID: 37750304
if your cgi returns an error (anything different from 0) the server returns 500 unless configured otherwise the ErrorDocument just contains the response body, the status will be 500
0

Featured Post

Get your Conversational Ransomware Defense e‑book

This e-book gives you an insight into the ransomware threat and reviews the fundamentals of top-notch ransomware preparedness and recovery. To help you protect yourself and your organization. The initial infection may be inevitable, so the best protection is to be fully prepared.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Hi, in this article I'm going to teach you how to run your own site, and how to let people in (without IP). I'll talk about and explain each step... :) By the way, everything in this Tutorial is completely free and legal. This article is for …
A year or so back I was asked to have a play with MongoDB; within half an hour I had downloaded (http://www.mongodb.org/downloads),  installed and started the daemon, and had a console window open. After an hour or two of playing at the command …
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
Suggested Courses

765 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question