By camperqueenie on
Drupal 7. Danland theme.
I'd like to change the generic Access Denied message to a custom text. I have created a node (Basic page) with the custom text and pointed the Default 403 to it in Configuration/System/SiteInfo. Saved it. Logged out. When I go to the site as an Anonymous User, I still get the Default 403 message.
Any suggestions? Thanks.
Comments
Have you logged back in and
Have you logged back in and cleared the site caches? Did you do a hard reload on the page to make sure your browser wasn't caching the "access denied" page it had already "seen"? Is your "basic page" (for 403 message) published and can anonymous users access other "basic page" content (permissions)? These might be the first things I'd look at for the solution to such an issue, but it could be something else. ;-)
Hope that helps.
See you at the Drupalcon!
Yes, I did all those things
I had logged out and done a hard refresh on the page, but hadn't emptied the caches. Did that, but still it doesn't work.
It must have to do with permissions.
I want the website to be set up so that Authenticated Users can see all content after Registration and Account Activation, but Anonymous Users will see a custom Access Denied message that reads something like "This website is for "? club" members only. Members, please create an account using the Register link in the upper right corner. You will be notified when your account is activated. Thank you."
Right now, I have Authenticated Users only set up to view published content. Shouldn't Anonymous Users then get the 403 custom error message that I have pointed to at Site Info?
Thank you.
Unfortunately I am trying to
Unfortunately I am trying to do the same thing and have not unearthed an easy way to make this happen yet. I am thinking it is now custom module time...
Custom error module 7.x dev
Custom error module 7.x dev version appears to be working well enough to work for me. http://drupal.org/project/customerror
Alternative solution
Hi, I had this problem too.
In another thread I saw that if anon users can't see node content, then they also can't see your custom error message, because that itself is a node, which is why we're having this problem.
In my case I was already using Content Access module to control node access. Within that, I enabled content access by individual node (not just by content type), which gives a content access tab for each node of content (within that content type).
Within the node I had created with my custom error message, I granted anon user reader access, and now anon users do see my custom error message.
Good point...
Permissions to access the node that has the "access denied" custom message is important. Maybe it's appropriate to either use "basic page" for nodes that anyone can see (and custom or other content types, e.g. "Article" for member-content)... or to create a new content type for pages that you want anonymous users to be able to see before joining... and of course make sure that that content type can be accessed.
Node by node access can be a pain and lead to issues when migrating content (assuming it's by node ID), etc, so I try not to have "per-node" access if I can help it.
See you at the Drupalcon!