In this post we will discuss how to resolve few issues related to File not found and 404 not found issues in SharePoint 2013 sites which were migrated from moss 2007. Recently we found this issues in few sites and sub sites. All those are migrated from moss 2007 to SharePoint 2013.
All of the issues are came in default.aspx pages and few with other pages which are using Page layouts.
So below are the few things you can debug:
Page without page layouts:
If it is pages like default.aspx page then look if the page is checked out to someone. If yes try to checkin the page or overwrite checkin or discard check out. But in certain cases you might not be able to do anything. But you can run a powershell command to do that like below:
$spWeb = Get-SPWeb("https://Site URL/")
$spFile = $spWeb.GetFile("https://Site URL/default.aspx")
The above command will undo checkout the page.
Usually what happens is if a particular page is checked out by someone and you move the site from one server to another server, may be a migration issue or tool issue sometimes that shows as file not found issue.
The other thing you can try is, open SharePoint 2013 designer, take a backup of your default.aspx page. Then delete the default.aspx page. And then rename the backup default.aspx page to default.aspx page. This might solve the issue as well.
Page with page layouts:
Sometimes you can also find the same file not found issue while opening a page which was having page layout attached to it. Till now I have faced two issues in this, first things is if really the page layout is exists or not.
To check whether page layout is correct or not, go to the page document library which will display all the page and in the page layout column it will show the page layout attached to the particular page. Click on the page layout and if it goes to File not found error then you need to put the page layout.
To upload the page layout go to Site settings page. Then click on "Master pages and page layouts" which is under "Web Designer Galleries". There upload your page layout to the Master pages and page layouts gallery.
Apart from this you can check the below thing specially if you have migrated from moss 2007 to SharePoint 2013 using Database upgrade approach.
Just check the url for the page layout for the particular page. Go to the Page properties and see the page layout path there. The path should be correct.
Recently we saw issue in one page where the page path it was taking was Test site rather than our production.
Hope this will be helpful.