Tuesday, 23 March 2010

How to create pages for "Page Not Found" and "Access Denied"?

Just go to "Create content" and select "Page." I title them "Access Denied" and "Page Not
Found
" but you can call them whatever makes sense to you and your users. When you
submit them, note the node ids. Then go to Administer >> Site Configuration >> Error Reporting  and
enter "node/__" in the appropriate boxes.

Suppose for Access Denied page node id is 8 and I give content as follows:

<p>We're sorry, but you must have permission to view the page you requested.</p>
<p>&nbsp;</p>
<p>If you are already a registered member of this site, please try <a href="user">logging in</a>.</p>
<p>&nbsp;</p>
<p>If you are not a member, you need to <a href="/join_us">join us</a>.</p>
<p>&nbsp;</p>
<p>If you have any questions about our site or group, please feel free to <a href="/contact">contact us</a>.</p>
<p>&nbsp;</p>
<p>--Webmistress</p>


And for Page Not Found page node id is 9 and I give content as follows:

<p>Sorry! The page you were looking for no longer exists. We redesigned our site and many of the pages have
changed.</p>
<p>&nbsp;</p>
<p>If you are unable to find something on our new site or have a question about our site or services feel free to
<a href="/contact">contact us</a>.</p>
<p>&nbsp;</p>
<p>--Webmistress</p>

Now go to Administer >> Site Configuration >> Error Reporting
Here, assign your content node id and Save Configuration.


So, we will give node/8 for Access denied and node/9 for Page Not Found.


Also, you can create page for both :

Page Not Found: page-node-8.tpl.php

Access Denied: page-node-9.tpl.php

Enjoy Drupaling !

Cheers!

1 comment: