0

I’ve inherited a SharePoint Online intranet that is barely configured, and I am new to the administrative tool.

When we go to our domain e.g., company.sharepoint.com it resolves to company.sharepoint.com/SitePages/Company-Home.aspx.
This page is filled with junk and I want to remove it completely, and instead have the domain resolve to company.sharepoint.com/sites/CompanyHome which is configured properly.

I tried to use the set as homepage option but nothing seems to have changed, and I can’t find the magic spot that would let me accomplish my goal. If I can’t simply point to the /sites/ version, is there an easy way to copy/move the /sites/ version up to replace /sitepages/ existing content?

0

From the URLs you provided:

company.sharepoint.com

and

company.sharepoint.com/sites/CompanyHome

are two different site collections. The first is the root site collection for the web application, and the second is a site collection on the managed path /sites/. You can't use a page from one site collection as the home page for another.

So if you want people who go to your web application root to actually end up at /sites/CompanyHome, your only option would be to do a redirect. Clear out the PlaceHolderMain contents of the original Company-Home.aspx page, and replace them with something like:

<script type="text/javascript">
window.location.href = "/sites/CompanyHome";
</script>

Update

After a bit of rooting around, there is no good way to move a modern page between site collections. And no good way to use a modern page as your home page on the root site collection. So, if you want to use a modern home page, don't put it in the root site collection. That, I gather, is what most people seem to recommend right now, just ignore your root site collection.

But that's not a very satisfying answer, and if you want people in the root site collection to automatically be redirected to another site collection with your modern landing page, use a classic page on the root site collection, add a script editor to it, and use the technique I described above to redirect to your modern landing page.

There's just one slight problem with this, and that is that the root site collection is set to noscript by Microsoft. You need to turn that off. The simplest way to do that is, first download the SharePoint Online Management Shell. Then run this in it:

Connect-SPOService -Url https://[yourtenant]-admin.sharepoint.com -credential admin@[tenant].onmicrosoft.com Set-SPOSite -Identity https://[yourtenant].sharepoint.com/[siteurl] -DenyAddAndCustomizePages 0

Ref: 4 ways to enable Custom Scripts for a SharePoint site collection

I believe you need to be a farm admin to do this (if not, certainly an SCA). Obviously, he describes 3 other ways to do this in the post I referenced. They all look more complicated than the way I described above, I haven't tried any of them, and I expect you'd need the same level of access to do any of them.

The catch is that this doesn't turn off noscript immediately. It happens in a timer job behind the scenes which Microsoft officially says can take 24 to 48 hours to take affect. I've never seen it take more than a few hours myself, usually under an hour, but maybe I'm just lucky (all other evidence to the contrary ;).

Anyway, you'll know it's done when you can edit a classic page, choose insert a web part, and select either the content editor or script editor web parts (both not available on noscript). Once that works, you can use the technique in my original answer.

BTW, you can make any classic page the home page on the root site collection just by opening it and selecting Make Home on the Page tab of the Ribbon.

Update 2

Figured I should add a reference for my assertions about modern home pages in root site collections:

Creating a Modern Home Page for the Root Site in a Tenant - Marc Anderson

Update 3

You know the old saying, if you don't like the way SharePoint online works, wait 10 minutes ;)

This post contains some new information about making your root site collection a modern site:

Convert/Change the built-in root site collection into a communication hub site

Apparently, there was an announcement at #MsIgnite that there is a new way to convert your root site to a modern communications site using a new Powershell command. But this command is not generally available yet.

The other answer on that post also provides a method to create a communications site at the web application root in SharePoint online, but this method requires deleting your root site collection thus losing all data. I haven't tried this.

And neither one of these will actually make it any easier to move a modern page from a site collection in a managed path to the root web.

  • Thanks @Joe, we are using O365 Online version of SharePoint so I don’t think there is a designer tool available for that. I would happily copy the page to the root like you mention once I find a method to do that. It is very frustrating that this isn’t easier to do! – Tim Purdie Feb 18 at 19:10
  • Hey @Tim, so the problem is that your on modern experience and since it's your root site collection, Microsoft makes the site noscript by default. You can turn that off with powershell, I just did it a couple days ago, I'll try to dig up how and update my answer. Then you could just add a CEWP to do the redirect. – Joe McShea Feb 18 at 21:19
  • BTW, I believe Microsoft's official stance is that designer isn't supported in SharePoint online, but it still works just fine for editing classic pages, and until they make some alternative available, I'll happily use it if I need it. – Joe McShea Feb 19 at 0:49
  • Thank you very much Joe - I will work with my team to solve this and hopefully this works. – Tim Purdie Feb 19 at 1:19
  • Correction, designer is still supported in SharePoint online, they're just starting to recommend not using it online. – Joe McShea Feb 19 at 13:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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