By armanschwarz on
This is an issue that has been brought up hundreds of times on these forums, yet a solution that "just works" doesn't seem to be found. I have been trying to deal with this issue to no avail, and have found, at least on my setup, that the drupal settings do not work at all (ie. changing to a custom node in error reporting has no effect) and the "custom error" module doesn't work either.
I'd like to put together a tutorial on this, but to do that I need to know what's going on myself first! Something I would reallly like to do is this:
301 redirect of all users who visit www.mysite.com/unknown/url to www.othersite.com/unknown/url
Can this be done? What about for the access denied pages?
Comments
my approach might not be the
my approach might not be the most elegant (i've read about concerns in using a node for these two scenarios), but this has been working for our site... i simply created two new pages (nodes), customizing them accordingly...
i then applied a URL alias for both, sending one to the path of "access-denied" and the other to "page-not-found"...
next, under error reporting, i entered the same corresponding paths for both pages... now, when someone attempts to access a restricted page, they are redirected to my customer "access-denied" page... likewise, when someone tries to reach a page that doesnt exist, they land at my "page-not-found" (and both events are written to the log)
Thanks, but I don't quite
Thanks, but I don't quite understand, maybe you can clarify:
i then applied a URL alias for both, sending one to the path of "access-denied" and the other to "page-not-found"...What do you mean by this? how do you alias a page to access denied/page not found? This would be ideal for me I just don't quite understand what you mean/how you did it...
absolutely... let me see if i
absolutely... let me see if i can clarify... i'll just use the "access denied" scenario, but the exact same steps apply to "page not found"...
1) used node/add/page to create a new page (in my case it ended up being node/75); this has my custom message / directions / etc for delivering the access denied message to a user
2) used admin/build/path to create an alias for the path, aliasing node/75 with access-denied
3) used admin/settings/error-reporting and entered access-denied as a custom path for Default 403
does that help?
I had done the same as you suggested. But..
I had followed all the 3 steps. But still access denied page is not coming up. It is still giving as "You are not authorized to access this page." May be this is because of the user permissions are removed for "access content" for anonymous users. Please suggest me, how can I overcome this situation....
Here is a potential solution using blocks
See this blog entry for a potential solution using a block shown to anonymous users, instead of using a node they don't have access to.
Thanks for helping
Thanks for showing me the solution.