You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by "Igor Yu. Zhbanov" <bs...@uniyar.ac.ru> on 2005/06/01 14:42:53 UTC

[users@httpd] Is it possible to get rid of error_log entry when using ErrorDocument for 404?

Hello!

// Apache/2.0.53 (Unix) PHP/4.3.10

I am using .htaccess to set handler for missing documents. They are not really
missing. It is a trick to have beautiful URLs when generating site content
from a database.

So, I have following .htaccess:

--- BEGIN ---
ErrorDocument 404 /~bsg/e/found.php
---  END  ---

And the found.php is:

--- BEGIN ---
<?php
header ("HTTP/1.0 200 OK");
?>
<html>
<body>
<?php
echo "Hello! You are looking for '${_SERVER['REQUEST_URI']}'\n";
?>
</body>
</html>
---  END  ---

The script even sets HTTP status to "200 OK" but it didn't help.

Is there a way to tell Apache from error document that everything is alright
and I don't want a record in error log?

Thanks.


---------------------------------------------------------------------
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


Re: [users@httpd] Is it possible to get rid of error_log entry when using ErrorDocument for 404?

Posted by Joshua Slive <js...@gmail.com>.
On 6/1/05, Igor Yu. Zhbanov <bs...@uniyar.ac.ru> wrote:
> Hello!
> 
> // Apache/2.0.53 (Unix) PHP/4.3.10
> 
> I am using .htaccess to set handler for missing documents. They are not really
> missing. It is a trick to have beautiful URLs when generating site content
> from a database.

> Is there a way to tell Apache from error document that everything is alright
> and I don't want a record in error log?

You can adjust LogLevel, but that probably isn't smart.

If you can express the set of URLs that you want covered by this in a
regular expression, then you should use a technique like
AliasMatch ^/path/.* /home/bsg/public_html/e/found.php
Otherwise, mod_rewrite provides various methods for doing stuff like
this.  The rewrite guide even has an example for testing if a file
exists.

Joshua.

---------------------------------------------------------------------
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