Question

Here's the issue. I have a custom landing page that's deployed to "_layouts/myfeaturename/home.aspx" The problem is, how do I map this as the default landing page?

If you click on the top node in the drop down from the little folder icon with the arrow:

arrowfolder

it takes you to domain/default.aspx . How can I redirect this page to the _layouts/myfeaturename/home.aspx page (since domain/default.aspx should be unused and non-accessible) or set the default landing page to the home.aspx?

It's my understanding that you can't just edit the default.aspx file because it's virtualized as the default landing of every STS site you create.

I tried the PowerShell method outlined here:

http://techtrainingnotes.blogspot.com/2011/06/sharepoint-how-to-change-default-home.html

but that didn't work. When I "echo $folder" it says the landing page is _layouts/myfeaturename/home.aspx, but it doesn't navigate there.

Any help would be rad, and very much appreciated.

Was it helpful?

Solution

SharePoint requires the WelcomePage to be a sitepage (not in _layouts), if it isn't it'll use default.aspx, so you have to introduce a redirect page as I suggest as answer to the question Change default site in Sharepoint foundation

Or you can just use Sharepoint Designer to give default.aspx the content I suggest for redirect.aspx

OTHER TIPS

After a fresh deployment, verify that you can physically browse to ".../_layouts/CustomPages/Home.aspx." If you are able to browse the page then you know that it was successfully deployed.

Your code to set the welcome page looks sound and matches up to an answer on a related question (an answer with seven upvotes at the time of writing). A couple of troubleshooting steps:

  • Add some error handling and logging to get more visibility. You don't mention any errors in your question, but be certain that none are being thrown.
  • Use SharePoint Manager (be sure to download the correct version) to compare relevent properties before and after your feature receiver code runs.
  • It probably doesn't matter at all but try lower casing the "l" in "_Layouts." Leave nothing to chance with SharePoint development...

What you don't mention is what kind of sites you are activating this feature on; I'm assuming publishing sites; the structure of the welcome page URL can depend on the type of web you're dealing with (site-relative or folder relative). See MSDN.

disable the minimal download optimization for the page to correct this and then set the default page from iis - inetmgr.

hope this helps

Licensed under: CC-BY-SA with attribution
Not affiliated with sharepoint.stackexchange
scroll top