Mengatasi Sorry you are not allowed to access this page pada halaman admin wordpress

Saya akan berbagi pengalaman saya menggunakan wordpress ketika ada pesan “Sorry you are not allowed to access this page” pada halaman login dan admin wordpress. pada kasus ini saya menggunakan Nginx sebagai web servernya. error ini muncul pada saat website saya menggunakan ssl atau https. oke, langsung saja, kita hanya perlu menambahkan beberapa kodingan di wp-config.php.

tambahkan kode

if (strpos($_SERVER['HTTP_X_FORWARDED_PROTO'], 'https') !== false){
    $_SERVER['HTTPS']='on';
}

taruh kodingan di atas di dalam file wp-config.php, dan peletakanya harus di paling atas, dibawah “<?php”

berikut ini full kodinganya:

<?php

if (strpos($_SERVER['HTTP_X_FORWARDED_PROTO'], 'https') !== false){
    $_SERVER['HTTPS']='on';
}

/**
 * The base configuration for WordPress
 *
 * The wp-config.php creation script uses this file during the installation.
 * You don't have to use the web site, you can copy this file to "wp-config.php"
 * and fill in the values.
 *
 * This file contains the following configurations:
 *
 * * MySQL settings
 * * Secret keys
 * * Database table prefix
 * * ABSPATH
 *
 * @link https://wordpress.org/support/article/editing-wp-config-php/
 *
 * @package WordPress
 */

// ** MySQL settings - You can get this info from your web host ** //
/** The name of the database for WordPress */
define('DB_NAME', 'abcde');

/** MySQL database username */
define('DB_USER', 'abcde');

/** MySQL database password */
define('DB_PASSWORD', 'abcde');

/** MySQL hostname */
define('DB_HOST', 'abcde');

/** Database charset to use in creating database tables. */
define('DB_CHARSET', 'utf8mb4');

/** The database collate type. Don't change this if in doubt. */
define('DB_COLLATE', '');

/**#@+
 * Authentication unique keys and salts.
 *
 * Change these to different unique phrases! You can generate these using
 * the {@link https://api.wordpress.org/secret-key/1.1/salt/ WordPress.org secret-key service}.
 *
 * You can change these at any point in time to invalidate all existing cookies.
 * This will force all users to have to log in again.
 *
 * @since 2.6.0
 */
define('AUTH_KEY',         '@[lP%G <g(X#t/Zokm@7m]N_zWkQSKg`(?,``BBd8LYEz}KNqv|>yuuk utd84wq');
define('SECURE_AUTH_KEY',  'OUJ4Qbx|SF +Zd]z5f^)2y{@lkNB/UzO:m^@IPky8>P?c))$Co9:2nFSK&YwlPvH');
define('LOGGED_IN_KEY',    '8G[b?zK=B/>I=wu:1H<ZlY6h{v$N$^U(as`;YQdABnAZg>K_VT[&^S7e;A?uy;kN');
define('NONCE_KEY',        'Bse,4^!P3BOHdhG6#}Ex6._7rEpKUEXz(0DKdd)/<uDt$YxEyi&MEqpv<elwE4.f');
define('AUTH_SALT',        'WDbo)Zks2b,c^aTDvvLMJlSc5CQuMx1hoOkdF}@3C{( L8X~KuBd$?la={,8L`b|');
define('SECURE_AUTH_SALT', 'r$Fv6@pNe?VjMn7Es8;,w)+x,h8>F[s;05|ddOJ%j7}emJiM5_%?M(lw9Iic~OAY');
define('LOGGED_IN_SALT',   'Tk9$nlSLkj-W9s( 7,UyA!dPv<8`l:_V88Nl8akQ[2zneE#R6bcOd  arBA/p-%<');
define('NONCE_SALT',       'yW<J0%e7!NAFYwWh*F^Cb%[K!g46Swf7gPa9o]-C:3?p^XDxn;!)F/Ry/1G9c;/v');

/**#@-*/

/**
 * WordPress database table prefix.
 *
 * You can have multiple installations in one database if you give each
 * a unique prefix. Only numbers, letters, and underscores please!
 */
$table_prefix = 'wp_';

/**
 * For developers: WordPress debugging mode.
 *
 * Change this to true to enable the display of notices during development.
 * It is strongly recommended that plugin and theme developers use WP_DEBUG
 * in their development environments.
 *
 * For information on other constants that can be used for debugging,
 * visit the documentation.
 *
 * @link https://wordpress.org/support/article/debugging-in-wordpress/
 */
define('WP_DEBUG', false);

/* Add any custom values between this line and the "stop editing" line. */



/* That's all, stop editing! Happy publishing. */

/** Absolute path to the WordPress directory. */
if (!defined('ABSPATH')) {
    define('ABSPATH', __DIR__ . '/');
}

/** Sets up WordPress vars and included files. */
require_once ABSPATH . 'wp-settings.php';


/** SSL */
if (!defined('FORCE_SSL_ADMIN')) {
    // define('FORCE_SSL_ADMIN', true);
}


Silahkan buka kembali halaman login dan admin..