admin管理员组文章数量:1122832
EDIT: Turns out the solution was to simply re-install wordpress (it was a new blog anyways). Still not sure what the issue really was but that solved it.
I have tried every single fix on stackexchange and other websites and nothing has resolved the issue.
I have checked to see that wp_ is in front of all my tables. I have updated http:// to https:// everywhere in the database. I have tried the FORCE_SSL_ADMIN thing with/without $_SERVER['HTTPS']='on' etc. etc.
I currently have this in my wp-config.php. I have tried placing it at the top at the bottom, and everywhere in between:
define('FORCE_SSL_ADMIN', true);
if ($_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https')
$_SERVER['HTTPS']='on';
I currently have this in my htaccess above the wordpress stuff (have also tried putting it below):
RewriteEngine On
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteRule ^(.*) https://www.%{SERVER_NAME}%{REQUEST_URI} [L,R=301]
RewriteCond %{HTTPS} off
RewriteRule ^(.*) https://%{SERVER_NAME}%{REQUEST_URI} [L,R=301]
I know the issue is because user capabilities are not getting set with https for some reason. I just don't know why or how to fix it.
For example, all these capabilities are set with http but not https:
[switch_themes] => 1
[edit_themes] => 1
[activate_plugins] => 1
[edit_plugins] => 1
[edit_users] => 1
[edit_files] => 1
etc.
I get: "Sorry, you are not allowed to access this page." no matter what I've tried.
I am about ready to throw in the towel and just offer to pay somebody because I've spent 3 days on this now but I figured I'd ask on here first.
Any help would be appreciated!
EDIT: Turns out the solution was to simply re-install wordpress (it was a new blog anyways). Still not sure what the issue really was but that solved it.
I have tried every single fix on stackexchange and other websites and nothing has resolved the issue.
I have checked to see that wp_ is in front of all my tables. I have updated http:// to https:// everywhere in the database. I have tried the FORCE_SSL_ADMIN thing with/without $_SERVER['HTTPS']='on' etc. etc.
I currently have this in my wp-config.php. I have tried placing it at the top at the bottom, and everywhere in between:
define('FORCE_SSL_ADMIN', true);
if ($_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https')
$_SERVER['HTTPS']='on';
I currently have this in my htaccess above the wordpress stuff (have also tried putting it below):
RewriteEngine On
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteRule ^(.*) https://www.%{SERVER_NAME}%{REQUEST_URI} [L,R=301]
RewriteCond %{HTTPS} off
RewriteRule ^(.*) https://%{SERVER_NAME}%{REQUEST_URI} [L,R=301]
I know the issue is because user capabilities are not getting set with https for some reason. I just don't know why or how to fix it.
For example, all these capabilities are set with http but not https:
[switch_themes] => 1
[edit_themes] => 1
[activate_plugins] => 1
[edit_plugins] => 1
[edit_users] => 1
[edit_files] => 1
etc.
I get: "Sorry, you are not allowed to access this page." no matter what I've tried.
I am about ready to throw in the towel and just offer to pay somebody because I've spent 3 days on this now but I figured I'd ask on here first.
Any help would be appreciated!
Share Improve this question edited Nov 16, 2018 at 14:18 WMaster99 asked Nov 14, 2018 at 19:02 WMaster99WMaster99 12 bronze badges 4 |2 Answers
Reset to default 0I would recommend NOT forcing HTTPS quite yet. Instead, remove all that stuff in wp-config.php and in the .htaccess. Then, login to WordPress making sure you're using the HTTPS link.
If you can login, then you now know you can login as both HTTP and HTTPS. Then, you can force HTTPS. If you can login at HTTP but not HTTPS, then I would recommend changing your SALT keys in your wp-config.php file (https://api.wordpress.org/secret-key/1.1/salt/) and visiting the site again in private browsing mode.
SSL certificates get cached by your browser and changing the SALT keys can often force these pesky caches to update.
Similar to @justin-downey I'd do the following:
1) Remove all the htaccess, wp-config settings 2) Work from a different browser completely in order to avoid browser cached versions 3) Login to MySQL and check wp_options for the home_url and site_url and make sure they are both set with HTTPS -- that should be the ONLY place HTTPS is configured.
You should be fine from there, then add your htaccess redirect -- skip the wp-config rules since all will work fine with the url set correctly in the database.
本文标签: Cannot access wpadmin after installing SSLuser capabilities not being set
版权声明:本文标题:Cannot access wp-admin after installing SSL - user capabilities not being set 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736283000a1926822.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
FORCE_SSL_ADMIN
and check forHTTP_X_FORWARDED_PROTO
are before the line that includeswp-settings.php
. You could also try to check that "https" exists inHTTP_X_FORWARDED_PROTO
instead of checking if it is an exact match, withfalse !== strpos( $_SERVER['HTTP_X_FORWARDED_PROTO'], 'https' )
– Cristiano Baptista Commented Nov 14, 2018 at 22:29