Is it possible to redirect to a custom page if user doesn't have permission to view a page?

Permalink
I was wondering if it's possible to redirect someone to a custom page if they don't have permission to view the page, instead of redirecting to the login page. We would prefer to keep our login page as hidden as possible, and whenever someone tries to access a page that they don't have permission to view, they are taken to the login page, which we would prefer not to happen.
Is there a way to redirect to a custom page?

 
tallacman replied on at Permalink Reply
tallacman
This gem may do it:
http://www.concrete5.org/marketplace/addons/url-director/...

You'd have to contact the developer to check for sure.
dsw528 replied on at Permalink Reply
Thanks for directing me to this add-on!

The developer of the add-on said it doesn't do it at the moment, but it could be added.
slafleche replied on at Permalink Reply
slafleche
FYI, i'm also interested in adding this feature and would buy it for some of my sites.
slafleche replied on at Permalink Reply
slafleche
I found out where Concrete does this:

It's in \concrete\dispatcher.php line 190. I replaced the contents of the switch case with a redirect.

switch($cp->getError()) {
    case COLLECTION_FORBIDDEN:
    header( 'Location: '.YOUR_CUSTOM_LOCATION );
    /*
    $v = View::getInstance();
    $v->setCollectionObject($c);
    $v->render('/page_forbidden');
    */
    break;
}