Successful login with 'requireLogin' redirects to 404.shtml I have recently migrated an intranet to its production environment, and the requireLogin is misbehaving:


I'd go to intranet.example.com/
Log in with my details
Craft will redirect me to intranet.example.com/404.shtml, showing 'Layout file - This content should not be seen.'


this page doesn't exist, and I can't find any reference to 404.shtml on any page. 

If I reload intranet.example.com/, it will show me the homepage, logged in. It works fine after that
I can log out and in again, it will work fine. I need to log out, close the browser and log in again to replicate the error


I have no redirects or have changed anything on the Craft config. Basically is a default 2.5 installation with new templates.

It works fine both locally (MAMP) and on my dev environment, but not on the server I just migrated it to.
I checked the http headers, and apparently my server was redirecting to a 404 page because the favicon.ico was missing. 

As soon as I uploaded one it all worked fine again.