Access Denied Page Redirect?

Hi,

When you first go to the webpage I’m working on, it brings you to the Drupal CERN “Access denied” message. I would like for it to instead direct the user to sign in to their CERN account then redirect them to the webpage. Is there a simple way to do this?

Thanks,
Alec

Hi, there are some instructions here which explain how to do it. I did it on two of my websites and it works well: Redirect non-authenticated users to SSO page

Cheers,
Jon

Jon,

Thanks so much! I’ll take a look into this.

-Alec

Hi Jon,

I implemented the suggestions in the forum post you sent me. Now, users get the access denied error, sign in, then get redirected to the home page of my website.

That’s all well and good, but simply redirecting them under basic site settings to /user/login yields this odd error:

It does this after redirecting several times, to the URL webpage/cern-dev-status/access-denied. I’m assuming this has something to do with the site being a development site, since going directly to webpage/user/login works. Do you know what I can do to fix this?

Hi Alec,

To be honest, I don’t really know. I just followed the instructions in the link and everything worked fine. My sites are not development sites though. I assume you already tried clearing the sites cache?

Hi Jonixon,

I tried clearing caches and all that, still no luck. It’s really not a big deal, just having it redirect to the home page works just fine. Thanks!

-Alec

Dear Alec,

Check if you have the CERN dev status module enabled. If yes then it messes up with the workflow that you want to setup.

You should disable the module and try again.

Hi Sboutas,

I did just that. It seems to have sortof worked. Using the “redirect 403 to user login” package works now, kindof. It now makes un-authenticated users log in, then takes them to their /user/usernumber page instead of the home page if the configuration is like so:

If if set the configuration like so, I get the same “too many redirects error”

Finally, if I set the configuration like so, Drupal displays the “you are not authorized to access this page”, then redirects to the home page after login:

Ideally, I would like for the user to go to the web page and be directed to the /user/login page. After logging, in they’d be redirected to their original destination. Short of that, I would be happy if it just took them to the home page. Unfortunately, I can’t get either of those to work! Do you have any advice?