Re: xaraya header responses (bug 1155) : possible/partial fixes

Jason <[email protected]> Tue, 07 Jul 2009 14:13:32 +0100
Newsgroups gmane.comp.cms.xaraya.devel
Organization Xaraya
Message-ID <[email protected]>
You can also put a 404 header into the base/message-systemerror.xt template,
after checking for the module not being action. This is what I use (with some of
the style details stripped out). You may also want to pull in the administrator
e-mail as the contact:


<xar:if condition="$id eq 'MODULE_NOT_ACTIVE'">
    <xar:set name="dummy">header('Not Found', true, 404)</xar:set>

    <div>
        <h1>Page Not Found (404)</h1>
        <p>The page you requested does not exist. It may have been moved,
deleted or simply mis-keyed.</p>
        <p>Please check the address, click on a menu link, or try the search
box.</p>
        <xar:if condition="!empty($_SERVER['HTTP_REFERER'])">
            <xar:set
name="referer">#xarVarPrepForDisplay(rawurlencode($_SERVER['HTTP_REFERER']))#</xar:set>
        <xar:else />
            <xar:set name="referer">'Not%20known'</xar:set>
        </xar:if>
        <p>If you think there should be a page here,
            <a class="mailto"
href="mailto:[email protected]?subject=Missing%20Page&amp;body=Page:%20#xarVarPrepForDisplay(rawurlencode(xarServerGetCurrentURL(array(),false)."\n"))#Referrer:%20#$referer
. rawurlencode("\n")#">please let us know</a>.
        </p>
    </div>
<xar:else />

...the usual stuff for other errors...

</xar:if>


Here it is in action:

http://www.iema.net/qwerty

-- Jason


Roger Rogerson wrote:
> I've just added some info to 
> http://bugs.xaraya.com/show_bug.cgi?id=1155
> 
> This may help solve part of hte issue with Xaraya only sending 200 responses.
> The code changes should result in Xar sending 503 responses for some of the more critical errors.
> It also points out that you can tweak some of the Base Templates to send Header() responses for errors handled by Xaraya.
> 
> Autocrat
> 
> _________________________________________________________________
> Get the best of MSN on your mobile
> http://clk.atdmt.com/UKM/go/147991039/direct/01/