Redirect 403 to User Login (r4032login module).

r4032login is one of those small modules that can significantly improve Drupal user experience. Remember what happens if anonymous users, for example, are trying to access restricted content (such as admin pages)? They see this:

access restricted content

Not very helpful, especially if the login box is nowhere to be seen. Granted, you can actually configure default 403 and 404 pages, including user login. But in this case, you don't see the message at all (which is not very helpful either). r4032login solves the issue and even allows the users to go back to the page they tried to access in the first place. It's available for Drupal 6 and Drupal 7 (note the configuration path is different).

To configure the module on Drupal 6, got to admin/settings/r4032login. Make sure 403 is set to r4032login at admin/settings/error-reporting.

r4032 config drupal 6

On Drupal 7, all the settings are available at admin/config/system/site-information.

r4032 config drupal 7

You can still set the optional redirect page, if needed.

Now, when access restricted area, the user is redirected to the login page and the destination is appended to the url.

redirect to user login saving destination

Note: modules with the similar functionality are LoginTtoboggan and login destination.