Had this little error recently and thought I'd blog about it just incase anyone goes Googling for options on resolving it.
HTTP/1.1 404 Connection: close Date: Tue, 26 Aug 2008 01:40:55 GMT Server: Microsoft-IIS/6.0 MicrosoftSharePointTeamServices: 12.0.0.6039 X-Powered-By: ASP.NET

In my case it was because I was getting an error in the Event Log:
Event Type: Error
Event Source: Windows SharePoint Services 3
Event Category: Database
Event ID: 3760
Date: 26/08/2008
Time: 9:55:52 AM
User: N/A
Computer: PER1WEB01TST
Description:
SQL Database 'WSS_Content_Intranet' on SQL Server instance 'database\sql01' not found. Additional error information from SQL Server is included below.
Cannot open database "WSS_Content_Intranet" requested by the login. The login failed.
Login failed for user 'DOMAIN\svc_moss'.
For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.
Basically the database had been restored by our DBA and for some reason had lost it's security settings! What was throwing me off was the fact that Central Administration was working! This environment was a farm environment that had load balanced Web Front End servers, I would recommend isolating calls to the URL using host files to hit one server to debug the problem on one Event Log on one server.
There are plenty of other resolutions out there for this error as well...it's nearly as common as "Object Reference not set to an intance of an object"!