How to redirect to a certain URL if a page returns an "access denied" message?

Events happening in the community are now at Drupal community events on www.drupal.org.
DrupalCuckoo's picture

hi,

I think this problem can be solved with the rules module but I don't know how. I hope some one can help me on this one :-)

Current state:
- I've created a page with the panels module. This page is available at "www.domain.com/user/[uid]/friends" (so each user has his own "My Friends Page").
- User A tries to view the "Friends Page" of User B.
- If User A has no rights to view this page (i.e. they've no friends-relationship with each other) he will get an "Access Denied" Message. This is not very user-friendly.

Target state:
- If User A has no rights to view the "Friends Page" of User B, he should get redirected to the Profile Homepage (or to any other page which I've set up as target).

My main problem is that I don't know how to configure the conditions part of the rule properly to match with "Access Denied".

How can I accomplish this?

Thanks for any help.

best regards.

Comments

If you want a custom

seanpclark's picture

If you want a custom access-denied page you can set that up here:
/admin/settings/error-reporting

It may not be the Rules solution your looking if you need other conditions to be met, but certainly the easiest approach.

Drupal 7

heyehren's picture

In Drupal 7 this feature can be found in Configuration/ Site information

Hi,

Aamuktha's picture

@kleinermann.Many thanks kleinermann. I was searching it for a long time.Thanks for your post.

Cheers

@kleinermann. Thank you so

mac_dougal's picture

@kleinermann. Thank you so much... Thanks for your post.

Rules

Group organizers

Group categories

Categories

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds:

Hot content this week