Jahia Dev Forum > [Jahia 6.5] 404...

0 (0 Good)
0 (0 Bad)

[Jahia 6.5] 404 pages HOWTO

by  rvt »  2011/09/20 22:10

Here is a small howto to create your own 404 pages.

create a directory jahia.war/errors/sites/SITEKEY/ where SITEKEY is the sitekey is for the site you want to create custom error pages for. You can lookup the sitekey within jahia administration.

When the directory is created, copy all files from jahia.war/errors into your new directory jahia.war/errors/sites/SITEKEY

That's it!

you can now change the the jsp files to your convenience.
I only needed style changes so I just added a additional CSS file to modify the styles needed like this:

 

<head>
    <meta name="robots" content="noindex, nofollow"/>
    <link rel="stylesheet" href="${pageContext.request.contextPath}/css/admin-1.0.css" type="text/css"/>
    <link rel="stylesheet" href="${pageContext.request.contextPath}/errors/sites/SITEKEY/css/admin-1.0.css" type="text/css"/>
    <title><fmt:message key="label.error.400.title"/></title>
</head>
 
This will make it easy for me to later copy any new error pages to my directory and only add the additional CSS and voilà, everything is styled again!
 
Happy hacking....
  • [Jahia 6.5] 404 pages HOWTO
    2011/09/20 22:10

    rvt <p> Here is a small howto to create your own 404 pages.</p> <p> create a directory&nbsp;jahia.war/errors/sites/<em>SITEKEY</em>/ where&nbsp;<em>SITEKEY</em>&nbsp;is the sitekey is for the site you want to create custom error pages for. You can lookup the sitekey within jahia administration.</p> <p> When the directory is created, copy all files from&nbsp;jahia.war/errors into your new directory jahia.war/errors/sites/<em>SITEKEY</em>/&nbsp;</p> <p> That&#39;s it!</p> <p> you can now change the the jsp files to your convenience.<br /> I only needed style changes so I just added a additional CSS file to modify the styles needed like this:</p> <p> &nbsp;</p> <div> &lt;head&gt;</div> <div> &nbsp; &nbsp; &lt;meta name=&quot;robots&quot; content=&quot;noindex, nofollow&quot;/&gt;</div> <div> &nbsp; &nbsp; &lt;link rel=&quot;stylesheet&quot; href=&quot;${pageContext.request.contextPath}/css/admin-1.0.css&quot; type=&quot;text/css&quot;/&gt;</div> <div> <strong>&nbsp; &nbsp; &lt;link rel=&quot;stylesheet&quot; href=&quot;${pageContext.request.contextPath}/errors/sites/<em>SITEKEY</em>/css/admin-1.0.css&quot; type=&quot;text/css&quot;/&gt;</strong></div> <div> &nbsp; &nbsp; &lt;title&gt;&lt;fmt:message key=&quot;label.error.400.title&quot;/&gt;&lt;/title&gt;</div> <div> &lt;/head&gt;</div> <div> &nbsp;</div> <div> This will make it easy for me to later copy any new error pages to my directory and only add the additional CSS and voil&agrave;, everything is styled again!</div> <div> &nbsp;</div> <div> Happy hacking....</div>

  • Number of messages  185
    Registration date Sep 20, 2011
    Contact
    Share
    Feedback

    Get in touch

    Whether you are a current user or if you are just evaluating Jahia, we are here to help.

    Contact us

    Share this page