404 error page questions

146 views
Skip to first unread message

Walter

unread,
Jul 14, 2011, 2:00:31 PM7/14/11
to RedDot CMS Users
Hello everyone. Does anyone know how can I use Delivery Server to
provide a custom 404 error page per language variant? Each variant
has its own directory structure on the same domain. Is there a way to
analyze the offending URL, and then redirect to a language specific
page?

Thanks to info on the following pages/discussions, I've been able to
get proper 404 errors working:

http://groups.google.com/group/reddot-cms-users/browse_thread/thread/c305c9582178199c/7358c3169a85879f?lnk=gst&q=404&fwc=2
http://www.reddotcmsblog.com/how-to-generate-a-real-404-http-header-status-within-reddot-liveserver

Here's what my 404 error page currently looks like:

<rde-dm:attribute mode="write" source="request"
attribute="rdeResponseStatus" op="set" value="404"/>
<rde-dm:include content="path/to/english/error.php" />

If worse came to worse, I know that I could use javascript to redirect
to other pages - but I'd rather not use client-side methods.

Tim D

unread,
Jul 14, 2011, 4:40:16 PM7/14/11
to reddot-c...@googlegroups.com
You can use the include DynaMent to embed the page you want or use the Process DynaMent to redirect with 30x headers.

Also If you are using locale's you can have multiple language variants publish to the same content in different locals. With this the same content and the current locale will govern which language you see.

Walter

unread,
Jul 14, 2011, 9:35:50 PM7/14/11
to reddot-c...@googlegroups.com
Thanks for the reply Tim.  We are not currently using locales - I shall have to read up on them.

It seems though that DynaMents should be able to solve the problem.  The code below is not working, but illustrates what I'm trying to accomplish.  Am I on the right track?


<rde-dm:attribute mode="write" source="request" attribute="rdeResponseStatus" op="set" value="404"/>
<rde-dm:attribute mode="choose"> 
   <rde-rd:when test="request:'<%CURRENT%>' contains 'com/eng'"> 
      <rde-dm:include content="com/eng/error.html" />
   </rde-rd:when> 
   <rde-rd:when test="request:'<%CURRENT%>' contains 'deu/deu'"> 
      <rde-dm:include content="deu/deu/error.html" />
   </rde-rd:when> 
</rde-dm:attribute>

Tim D

unread,
Jul 15, 2011, 8:59:47 AM7/15/11
to reddot-c...@googlegroups.com
Hi,

Looks pretty close think you'd want to run your tests on these session variables found in dynaments manual appendix.

rdeErrorInfoCurrent
URL of the last request for this session. Exception: Not set for requests to the
standard Weblet for delivering BLOB content (alias: "xbcr").

or

rdeErrorInfoXml
Name of the last content item requested

If you were using locales you could compare against this:

rdeCurrentLocale
Language of the session This parameter is set during authentication. It can be read,
but not written.

Walter

unread,
Jul 18, 2011, 10:36:09 AM7/18/11
to reddot-c...@googlegroups.com
That's the missing link I was looking for.  Thanks!  Here's what I ended up with, and it works great.


<rde-dm:attribute mode="write" source="request" attribute="rdeResponseStatus" op="set" value="404"/>
<rde-dm:attribute mode="choose">
   <rde-rd:when test="session:rdeErrorInfoCurrent contains 'deu/deu'">
      <rde-dm:include content="deu/deu/error.html" />
   </rde-rd:when>
   <rde-rd:when test="session:rdeErrorInfoCurrent contains 'chs/chs'">
      <rde-dm:include content="chs/chs/error.html" />
   </rde-rd:when>
  
      ....Etc......

   <rde-rd:otherwise>

      <rde-dm:include content="com/eng/error.html" />
   </rde-rd:otherwise>
</rde-dm:attribute>
Reply all
Reply to author
Forward
0 new messages