I have a feature which deploys a master page and changes the masterpage for all webs in the site collection. This works okay usually. We've had an issue two times, where all the aspx pages in the site collection doesn't work anymore, and it looks like it's related to this feature.

What's happening is that suddenly all pages return a 404. I have to open each aspx page and copy the content to a new page. Today I found out that checking out and checking in the file will also fix the issue.

What's strange is that the "Last Modified" date of the pages are weeks back in time, even though something must have corrupted the file the last hour.

This really doesn't make sense to me. Anyone?

  • Are you doing anything that might be calling SystemUpdate() on these files? This would not change the Last Modified date. May 16, 2011 at 10:10
  • Nope, my feature is doing the following: Deploying masterpages, Deplying css and pictures, Iterating through all webs in site col, Changing MasterUrl and CustomMasterUrl, calling Update() (and Dispose())on all webs.
    – tarjeieo
    May 16, 2011 at 11:06
  • If you are using SharePoint 2010, how about just deploying the masterpages via feature, but change the custom master url and system master url externally via PowerShell? See if the same behaviour happens. (Eg: vasya10.wordpress.com/2011/03/26/…)
    – vasya10
    Jun 17, 2011 at 21:41

2 Answers 2


Are you sure it is the page returning 404 and not some item on the page or a dependency?

Assuming that is not the case, it sounds as though your reconfiguring of the master page has gone wrong. You will get a "404 Not Found" if the master page is missing.

Did you delete the old master page? Perhaps the master page link is wrong? When you re-create the page it will presumably have a valid link to the master page, which would explain why re-creating the page will work.

  • Or some sort of weird permissions issue where the masterpage isn't published?
    – Kit Menke
    May 16, 2011 at 15:22

I've had this before. If you have a custom control, webpart, or anything on your masterpage that isn't deployed, doesn't exist, or has an internal error, you will get this error.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.