[Solved] sorry you are not allowed to access this page. wordpress ssl

This “sorry you are not allowed to access this page. wordpress ssl” is quiet common in wordpress, this happens sometimes due to incorrect https setup/.htaccess redirection issues. Sometimes even plugins may create this issue. So lets resolve this error now using the most repeated case.

You must have cpanel access to follow the below steps and fix this issue.

Search “RewriteEngine on” in your .htaccess file and comment the snippets and enable the https snippets like below.

.htaccess:

comment this block from .htaccess file, because this will perform the redirects to http.

# http only
#RewriteEngine On
#RewriteBase /
#RewriteRule ^index\.php$ - [L]

After commenting the above snippets, then add the below code for https redirections.

RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{SERVER_NAME}/$1 [R,L]

wp-config.php:
Add the below snippets at the top of the file.

define('FORCE_SSL_ADMIN', true);
 if ($_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https'){
  $_SERVER['HTTPS']='on';
 }

Still not resolved ?

Then you renamed your plugin folder to plugin_old then check, if it works this time then this is because one of your plugin.

Then you need rename that back to plugin and start renaming one by one plugin to understand which one is actually creating the problem for you.

In our cases:

Mechanical visitors count plugin was the one which was creating the issues.

Leave a Reply