Web Hosting
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

WordPress fix “Sorry you’re not allowed to access this page” after migrating to https

Discussion in 'Misc WordPress Requests' started by akshatjiwan, Oct 23, 2017.

  1. akshatjiwan

    Guest

    “Sorry you’re not allowed to access this page” after migrating to https, by akshatjiwan

    Hello,

    I recently upgraded my wordpress to start using ssl certificates. In my database I also rewrote the urls to serve https files instead of http files. For the most mart the site works as expected, however I’m not able to access the admin panel even after I log in correctly using the user that has administrative privileges. It always redirects me to an error page with the following message

    “Sorry you’re not allowed to access this page”

    I tried to create a new admin user and log in with that but the result was the same.

    The wiered thing though is that when I switched back to http(non-ssl server) it started working perfectly again. I was able to login as an admin without any hitch.

    In my wp-config.php I made the following changes:-

    define(‘FORCE_SSL_ADMIN’, true);
    // in some setups HTTP_X_FORWARDED_PROTO might contain
    // a comma-separated list e.g. http,https
    // so check for https existence
    if (strpos($_SERVER[‘HTTP_X_FORWARDED_PROTO’], ‘https’) !== false)
    $_SERVER[‘HTTPS’]=’on’;

    Here is a link to the nginx configuration files that I’m using for my application.

    Can you please help me understand what might be causing this issue?

    Thanks,
    Akshat

    “Sorry you’re not allowed to access this page” after migrating to https
     
    #1

Share This Page

Web Hosting