This is an issue that’s been around for a while so I’m just re-posting an answer I’ve found on several sites, including http://www.eggheadcafe.com/community/aspnet/69/10104052/receive-404-page-not-found-error-when-going-to-useraspx-page.aspx.

I had to make this change on a farm recently so my post here includes a few more details that I didn’t see elsewhere.

Issue: On a SharePoint 2007 site, when browsing a user list in People and Groups, if you click on a user’s name, you should see a user information page. Instead, you get an error – "An unexpected error has occurred" or "Internet Explorer Cannot Display This Page".

Problem: If My Site was enabled at some point and then disabled, this can cause SharePoint to become delirious and confused. In other words, it’s a bug. J

Resolution: The userdisp.aspx page code needs to be changed on any servers providing web application services for the site (the web front ends, for example). On the servers, navigate to C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\TEMPLATE\LAYOUTS. Make a copy of the userdisp.aspx file – just in case, so you’ll have something to revert back to! Open the original using Notepad. Look for Scope="Farm" and change Farm to Web so that it reads Scope="Web". Save and close. Repeat on all web servers. It’s not necessary to reset IIS or reboot the servers. Users may need to clear their browser history, however. The page should now load with no issues.