[Linux-disciples] SSI and ErrorDocuments
Adam Rosi-Kessel
adam at rosi-kessel.org
Sun Sep 12 11:46:03 EDT 2004
Without testing it, couldn't you do something like
ErrorDocument 404 error/404.html
RewriteCond [...blah...]
RewriteRule ^.*$ nonexistent_url.html [r]
Then the nonexistent_url will call for a document that doesn't exist,
going then to the 404 error page.
On Sun, Sep 12, 2004 at 11:26:54AM -0400, Stephen R Laniel wrote:
> when someone visits /foo.html on a site that I've developed,
> he's actually -- via mod_rewrite -- visiting
> /template.shtml?foo.html. That, in turn, is an SSI page, and
> foo.html is included with a '<!--#include' directive.
>
> If foo.html doesn't exist, I'd like Apache to return a 404
> error and display /error/404.html. The trouble is that
> Apache doesn't return a 404 if one of the #included files
> doesn't exist.
>
> So that's my question: how do I get SSI to return a 404 when
> one of the #included documents doesn't exist? Right now I've
> got a hack going in mod_rewrite:
>
> #if the file is HTML and doesn't exist, return the templated 404
> RewriteCond %{REQUEST_FILENAME} \.html$
> RewriteCond %{REQUEST_FILENAME} !-f
> RewriteRule ^.*$ error/404.html
>
> But that doesn't actually return a 404 error, and
> consequently I can't grep through my error.log file to find
> all the nonexistent pages that people requested.
>
> Any ideas?
--
Adam Rosi-Kessel
http://adam.rosi-kessel.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://lists.bostoncoop.net/pipermail/linux-disciples/attachments/20040912/5556c173/attachment-0001.pgp
More information about the Linux-disciples
mailing list