title: SharePoint login page doesn't seem to load styles from /_layouts, throws error "value cannot be null"
body: <p>I have a custom login page for WSS 3.0 using forms-based authentication. It uses the simple.master masterpage provided in /_layouts, so when I go to my login page I expect to see the blue and yellow screen surrounding some branding and login components. This happens sometimes. On the other hand, sometimes I go to the login page and none of the styles are there; it just displays my login components against a white background. If I try to log in (whether with a valid or invalid login) I get:</p>
  
  <pre>Value cannot be null. 
  Parameter name: value   at System.String.EndsWith(String value, StringComparison comparisonType) 
     at Microsoft.SharePoint.ApplicationRuntime.SPRequestModule.PostAuthenticateRequestHandler(Object oSender, EventArgs ea) 
     at System.Web.HttpApplication.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() 
     at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) 
  </pre>
  
  <p>This null is not happening in my custom login code, it's within the SharePoint APIs. I've looked at them with Reflector and I believe that this exception is the result of not being able to load something within the client-side resources, which is strange but apparently the case.</p>
  
  <p>The issue happens intermittently. iisreset or recycling the app pool does not seem to make it go away, but sometimes it seems to just fix itself for an hour or so. I have seen some references to this problem on the web but none of the solutions mentioned have worked for me. It's easy to think you've solved this problem because of its tendency to suddenly go back to normal for a while.</p>
  
  <p>I've checked the directory permissions and the app pool identity can read /_layouts and its subfolders.</p>
  
  <p>Thanks.</p>
  
  <p>Update: I have some reason to believe, but little ability to test, that this happens when you copy a web.config wholesale from one server to another.</p>