Why and when you should be using relative links in SharePoint

Consider either of these scenarios:

Re-branding/Restructuring/Renaming

  • Your organization and its departments are re-structuring and changing names
  • Your IT department and content strategists decide on a new naming convention that affects your site names and URLs to access those sites OR you’re changing from http to https
  • You have hundreds (thousands?) of documents, links, content queries and script references across your sites that refer to the old URLs and are now broken

Copying Sites/Structures or Creating Templates

  • You need to create a team site template that contains default content and page designs
  • You create the template with script references, page and promoted links that are absolute
  • You have to update all of those links (some perhaps buried deep in your layouts folder) to the new site location URL unless those links are meant to call back to a different site.

Keep in mind that if a user doesn’t have access to the site or subsite library where referenced scripts are held, those scripts won’t run for that user no matter what. This can affect the look, feel, and function of the site which causes confusion and confidence issues when they call and you say “Looks fine to me!” and they have a different experience

Many of these issues and “cleanup tasks” can be avoided (for the most part) by using relative URLs instead of absolute URLs.

Continue reading “Why and when you should be using relative links in SharePoint”

Change a SharePoint site collection top-level site URL

Changing a SharePoint site collection name is easy enough (Site Settings –> “Title, description, and logo”), but changing the URL for a top-level site is a bit more involved than just changing a subsite URL. Note that this post applies to on-premise/server environments only.

Continue reading “Change a SharePoint site collection top-level site URL”

Change a SharePoint subsite name and URL

Sometimes “Marketing” becomes “Communication” or you’ve changed a site URL naming convention so that instead of “sharepoint.mycompany.com/marketing” you’ll be shortening all department sites to something like “sharepoint.mycompany.com/mark”. Follow these steps to change the name and URL for a SharePoint subsite.

Note: If you’re trying to change the URL for a top-level site (site collection level), you’ll need to change the URL as an administrator using PowerShell.

Continue reading “Change a SharePoint subsite name and URL”