URLs


URLs


Introduction

  • All URLs on your KU CMS site should be strategic and properly formatted
  • Simple and human-readable URLs are valuable for users and search engines (SEO)
  • Poor quality URLs can bring down the overall aesthetic and cleanliness of your site and damage the user experience online and in print

Strategy and Formatting

Like Page Titles and Headers, URLs should be as simple and clear as possible. Poor-quality URLs can make your site feel disorganized and messy creating a sub-par user experience. Additionally, although URLs do not have a major impact on search engine rankings, they can impact your SEO.

Be as strategic with your URLs as you are with your Page Titles and Headers – always create a clear relationship between your Page Title, Headers and URL.

Proper URL Formatting

  • Keep them short and simple – remove all extraneous words
  • Make them easy to type and remember (this is helpful if the URL is ever including in an email or in print)
  • Use hyphens between all words
  • Use URLs that help users understand the site location of the page (e.g., /people/name) and allow them to remove the last part of the URL to arrive at a higher-level site destination.

Do Not Use Absolute URLs for Internal Pages

IMPORTANT: Absolute URLs on a Sunflower development site will break with the site launches

  • Create links using relative URLs for internal pages
    • Relative URLs:  /yourpagename or /node/#
  • Absolute URLs will break when the site goes live.
  • Absolute URLs are necessary for external links, but should not be used for internal links.

How to create relative URLs?

  1. Type the page title in the link field and the page will appear in a dropdown menu. Once you select the page from the dropdown menu, Drupal puts in the relative path for you.
  2. If you know the specific path (e.g., /yourpagename) or node number (e.g., /node/427) for your page, you can type either of those in manually.

URLs with -0

During site creation if a page is created with the same name as an existing page Drupal appends -0 to the page name. This needs to be cleaned up before the site launches. To do so, delete the original page and update the URL alias of the -0 page to remove the -0.

NOTE: if multiple pages are created with the same name the appended name will be -1 etc.

URLs to Files Cannot Have Spaces

If a URL to a file is not working, it is likely caused by spaces in the name of the file.

Paths cannot include spaces in the file name or the folder name — a common error in file and folder naming. URLs with spaces render with %20 in place of the space. When a relative path includes spaces, the %20 symbol gets re-coded as %2520, which breaks the link.

The fix the issue, simply rename your file with underscores, dashes or camel case in place of the spaces.

Migrate the Same URLs or Create a Redirect

When you are migrating pages, be sure to use the same URL whenever possible. Keeping the same URL will ensure that those links do not break on other sites, bookmarks, or in print documents.

If you do need to change the URL, just remember to create a redirect on your new site. A redirect will allow you to change the URL and ensure that users find the correct page on your new site.

Common URL Errors

Redundant URLs:

  • Example: /about-0
  • Improved: /about

Common Cause: This URL error typically happens when more than one version of a page has been created with the same Page Title. Often an old version of the page is already using the desired URL and effectively blocking the ability to re-use it. The original page must be unpublished or deleted before the new page’s URL Alias can be set to the correct original URL.

Overly Long URLs:

  • Example: /annual-open-house-and-meet-and-greet
  • Improved: /open-house

Common Cause: Page URLs are created automatically based on your Page Title unless you uncheck Generate automatic URL alias in the URL Alias section. Remember to go to the URL Alias tab on the right side of the edit page and create a custom URL for each page unless the page title is the ideal URL.

URL Redirects

A URL Redirect is a technique which is used to redirect your site's visitors to a different URL. At times it may be useful to have traffic that would normally go to one page redirect to another page.

Add a Redirect

  1. Under Configuration
  2. Go to Search and Metadata > URL redirects > Add redirect
  3. Enter the Path of the of the page you wish to redirect
  4. In the To field type the path that you want users redirected to
  5. Select the Redirect status* from the drop-down menu
  6. Select Save

*NOTE: Most of the time you will want to use 301 Moved Permanently. For more information about the Redirect status codes.

Delete a Redirect

  1. Under Configuration
  2. Go to Search and Metadata > URL redirects
  3. From the Edit button drop-down menu on the right select Delete
  4. Select Delete to delete the redirect

Edit a redirect

  1. Under Configuration
  2. Go to Search and Metadata> URL redirects
  3. Select the Edit button
  4. Make the desired changes
  5. Select Save

Checking Redirects on Your Drupal 7 Site

Be sure to review the redirects on your Drupal 7 site. You may need to recreate some redirects on your new CMS Sunflower site to ensure that end-users arrive at correct destinations on your new site. This likely applies only to the pages on your site that get the most traffic – and are most likely to have been bookmarked or linked to from other websites.

If someone has bookmarked or linked a page on your Drupal 7 site and you recreate that page on your CMS Sunflower site with the exact same URL, users will end up on the correct page and no additional redirect action is required.

However, imagine a scenario where one of your most heavily-trafficked pages has had a URL change in the recent past. For example, if you originally created a page with the URL “/about-us” and then sometime later came back and updated the URL to be simply “/about.” If someone bookmarked or linked to “/about-us,” once your new site goes live they will no longer arrive at the correct destination because that page does not exist on your new site. You can correct for this by adding a redirect.

How To's

How to Create a Custom URL Alias

When creating or editing most KU CMS pages:

  • Locate URL Alias accordion (upper right on desktop, lower left at mobile)
  • If present, uncheck Generate automatic URL alias
  • Enter properly-formatted custom URL in URL Alias field
  • Set Save as state to Published
  • Select Save

Guidelines and Best Practices

  • Keep them simple – remove all extraneous words
  • Use hyphens between all words
  • When migrating use the same URL whenever possible - or add a redirect on the new site if you need to change the URL
  • Avoid automatically-generated URLs with numbers appended due to redundancy (e.g., /research-0)

Support