httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jeff Lee" <jeffleeismyh...@hotmail.com>
Subject Re: [users@httpd] Default Index File as CGI script
Date Thu, 11 Sep 2003 16:35:42 GMT
why not make that as one of the error pages for that website?

IE -  ErrorDocument 404 /cgi-bin/fake404.cgi


----- Original Message ----- 
From: "Brian Leader" <brian@ideaslive.com>
To: <users@httpd.apache.org>
Sent: Thursday, September 11, 2003 11:35 AM
Subject: [users@httpd] Default Index File as CGI script


> I'm trying to get a CGI script to run if a default index file is not found
> in my directory.  I'm following the instructions in the Wrox Professional
> Apache book.  What is says to add a cgi script to the end of the directory
> index file list as follows:
>
> DirectoryIndex index.html index.htm /cgi-bin/fake404.cgi
>
> I've done this and put the following file in my /cgi-bin directory:
>
> #!/bin/sh
> #
> # fake404.cgi
> # replace the top line with '@echo off' for Windows
> # BJL 9/11/03
>
> echo "Content-Type: text/html"
> echo "Status: 404 Not Found"
> echo ""
> echo "<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">"
> echo "<HTML><HEAD>"
> echo "<TITLE>404 Not Found</TITLE>"
> echo "</HEAD><BODY>"
> echo "<H1>Not Found</H1>"
> echo " The requested URL $REDIRECT_URL was not found on this server.<P>"
> echo "</BODY></HTML>"
>
>
> But when I try to access the URL from a browser, I get the following
error:
>
> Internal Server Error
> The server encountered an internal error or misconfiguration and was
unable
> to complete your request.
> Please contact the server administrator, root@localhost and inform them of
> the time the error occurred, and anything you might have done that may
have
> caused the error.
>
> More information about this error may be available in the server error
log.
>
> I'm not sure why since I believe I did things correctly.  But it looks
like
> the CGI file is not being run.  If I don't put the fake404.cgi file in the
> cgi-bin directory I get the standard 404 file not found error:
>
> Thanks,
>
> Brian
>
>
>
> Brian J. Leader
> brian@mythicwave.com
> 818-957-4950
>
>
>
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>    "   from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>
>

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message