Can not log in to Drupal 7 admin after changing to

2019-09-02 07:19发布

I can no longer log into Drupal 7's admin area after adding SSL certificate and forcing HTTPS in url.

The website was previously served via HTTP protocol and worked perfectly fine. I would also like to mention that if I revert back to HTTP mode, the site will work as expected. However, I am trying to implement HTTPS.

Additionally, while logging in, I have noticed that the cookie response would be sent by the server but it would get deleted immediately leading to access denied message.

So far, after going through mixed response in the internet, I have played around with session.cookie, $base_url and $cookie_domain variables within settings.php file. I haven't found a solution yet.

Has anyone bumped into this problem? Your response will be highly appreciated.

3条回答
劫难
2楼-- · 2019-09-02 07:48

In apache server
Go to .httaccess
Add # in front of RewriteRule ^ - [E=protossl] to disable http
It looks like this # RewriteRule ^ - [E=protossl]
This solves the problem

查看更多
【Aperson】
3楼-- · 2019-09-02 07:56
Disable in .httaccess
RewriteCond %{HTTPS} off [OR]
RewriteCond %{HTTP_HOST} ^www\.example\.com*
RewriteRule ^(.*)$ https://example.com/$1 [L,R=301]
查看更多
Melony?
4楼-- · 2019-09-02 08:11

Ok so this is a fairly old post but here is what happened with my site.

We installed a new SSL certificate and somehow the .htaccess file ended up empty, and I do mean 100% blank.

This means easy fix, download latest drupal core and just replace the .htaccess file along with the core files, usually you want skip this to preserve all additional code added for html compression and such, but in this case that is redundant.

After the .htaccess was replaced I then added the compression and rerouting code like before and problem solved.

Hope this helps someone else out, I know I will always be checking the .htaccess files first if it happens again.

查看更多
登录 后发表回答