<p>Finally i got it.</p>
<p><strong>It was an issue with the .htaccess</strong></p>
<p>I had not a default installation .htaccess, but a special one.</p>
<p>What helped in my case wa putting following into the .htaccess</p>
<pre><code>    # 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]
</code></pre>
<p>But also got issues similar to this answer afterwards: <a href="https://craftcms.stackexchange.com/a/35846/11140">https://craftcms.stackexchange.com/a/35846/11140</a></p>

CC BY-SA 4.0
2020-09-30T07:58:49.183Z
2020-10-09T09:32:21.553Z
2020-10-09T09:32:21.553Z
André Kelling
<p>After migrating a site to local i can't login into the backend-part <code>/admin/login</code>.</p>
<p>There is an error message in the browsers console log</p>
<blockquote>
<p>VM1974:1 POST <a href="http://great-site.localhost/index.php?p=admin/actions/users/login" rel="nofollow noreferrer">http://great-site.localhost/index.php?p=admin/actions/users/login</a> net::ERR_EMPTY_RESPONSE</p>
</blockquote>
<p>I debugged into the backend until the <code>return $this-&gt;asJson($return);</code> line 1671 in UserController (vendor/craftcms/cms/src/controllers/UsersController.php).
But somehow it seems to not return anything as the browser console says.</p>
<p>I am on Craft Version <strong>3.3.6</strong></p>
<p>PHP Version <strong>7.3.18</strong></p>
<p><strong>Questions upfront</strong></p>
<p>Could it be that i am running on http instead https now?</p>
<p>Could it be that i am not creating a session correctly?</p>

<craft3><login>
can't login after move site to local - empty response
# can't login after move site to local - empty response

(Asked by: username_0 on 2020-09-30)

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?

**Tags:** craft3, login

---

## 1 answers

### Answer by username_0 on 2020-09-30. Score: 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


---

