Default Access Denied and Default Not Found Pages

Drupal has an access system that determines what content a site visitor is allowed to see and which actions that visitor is allowed to execute. When visitors attempt so see content that they are not entitled to see or execute an action for which they do not have the necessary permissions, Drupal returns a page with the HTTP header 403 Access denied. The default behavior is to print a page that says "Access denied - You are not authorized to access this page." If you want to elaborate on this or present a different message, you can do so by creating a Drupal page and entering the Drupal path to that page in the Default 403 (Access Denied) Page field.

■ Note Drupal path refers to the part of the URL that comes after the ?q= in the URL, such as admin/access or node/4/edit.

Similarly, when Drupal receives a URL that cannot be mapped to an existing page or resource, it prints the message "Page not found." If you wish to expound on this, perhaps by offering some suggestions of popular content on your site, you can create a Drupal page and enter its path in the Default 404 (Not Found) Page field.

For example, you might want to create a different page to handle the 404 Not Found errors if you had pages or resources on your site that no longer exist but still get requested. Perhaps you used a dedicated blogging tool or a specialized bulletin board system on your site before deciding to switch to Drupal, and you notice from your server logs that people are still requesting URLs that point to the old, nonexistent system. You would want to make a Drupal page explaining that the resources have moved, with instructions on how to find them, and use that page's Drupal path as the value for the Default 404 (Not Found) Page setting.

Was this article helpful?

0 0

Post a comment