[Linux-disciples] SSI and ErrorDocuments

Stephen R Laniel steve at laniels.org
Sun Sep 12 12:05:41 EDT 2004


On Sun, Sep 12, 2004 at 11:46:03AM -0400, Adam Rosi-Kessel wrote:
> Without testing it, couldn't you do something like
> 
> ErrorDocument 404 error/404.html
> 
> RewriteCond [...blah...]
> RewriteRule ^.*$ nonexistent_url.html [r]

Hmm: check out how it works here:

http://jasonandfischer.com/foo.html

The trouble is that this gets rewritten to

http://jasonandfischer.com/nonexistent_url.html

which gets translated by a later rewrite into

http://jasonandfischer.com/template.shtml?nonexistent_url.html

Then the template tries to load nonexistent_url.html into
the right frame, finds that it doesn't exist, and gives the
same ' [an error occurred while processing this directive]'
message.

I tried tweaking Adam's idea to

RewriteRule ^.*$
http://jasonandfischer.com/newfischer/template.shtml?error/nonexistent_url.html
[L]

Same problem. Basically, whenever Apache passes the request
to the SSI template that I've set up, we run into the
problem that I'm talking about.

There ought to be a way to tell SSI itself to return a 404
error when the #include directive fails. It's possible to
customize the error message that SSI spits out when #include
fails [1], so it should also be possible to customize the
error code ... shouldn't it?

[1] - http://shorl.com/gibiverufrile

-- 
``Nobody ever picks yellow out of the [crayon] box just for
  the Hell of it, but once you start coloring in whatever
  coloring book or colored coloring you colored, there's a
  99.9% chance you'll eventually need the yellow for
  something. In that I cheerfully liken it to bay leaves.''
 -http://x-entertainment.com/articles/0913/

-------------- 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/6212603e/attachment.pgp


More information about the Linux-disciples mailing list