After migrating a site to local i can't login into the backend-part /admin/login.

There is an error message in the browsers console log

VM1974:1 POST http://great-site.localhost/index.php?p=admin/actions/users/login net::ERR_EMPTY_RESPONSE

I debugged into the backend until the return $this->asJson($return); line 1671 in UserController (vendor/craftcms/cms/src/controllers/UsersController.php). But somehow it seems to not return anything as the browser console says.

I am on Craft Version 3.3.6

PHP Version 7.3.18

Questions upfront

Could it be that i am running on http instead https now?

Could it be that i am not creating a session correctly?

1 Answer 1


Finally i got it.

It was an issue with the .htaccess

I had not a default installation .htaccess, but a special one.

What helped in my case wa putting following into the .htaccess

    # Remove www from URL's
    RewriteCond %{HTTP_HOST} ^www\.(.+)
    RewriteRule ^ http%2://%3%{REQUEST_URI} [L,R=301]

    # Remove trailing slashes
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)/$ /$1 [L,R=301]

But also got issues similar to this answer afterwards: https://craftcms.stackexchange.com/a/35846/11140

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.