URL Redirections in Agility CMS- Guide for Editors | Agility CMS Docs

URL Redirections

Easily manage and test your redirects across your site without requiring a developer. URL Redirections in Agility CMS provides a way for you to redirect a user from one URL to another URL.

A URL redirection, also known as URL forwarding, is a method that allows a web page to be accessed from several URL addresses. When a web browser tries to open a redirected URL, it is redirected to a page with a different URL.

Common Use Cases

Implementing redirects on a website is essential to managing your sitemap and preventing dead links. Typically, they are used to redirect an old URL to a new URL or provide a vanity URL (alias) that can be easier for users to remember. 

  • You've changed the URL of a page and want to ensure any existing links are redirected to the new link
  • You want to provide a shorter (vanity) URL for a longer URL
  • You are migrating from an old site to a new one and you want to re-map your URLs
  • You want to avoid 404 errors
  • You want to temporarily redirect users to another page

URL Redirections and their uses may also include:

To Force HTTPS

A website might be accessed using both a secure HTTPS URI scheme and ordinary HTTP.

To Redirect to Similar Domains

A URL might be mistyped by a user. These "misspelt" domains are frequently registered by businesses and redirected to the "right" site.

To Redirect Pages While moving to a New Domain

Incoming links to an old URL can be redirected to the proper site using URL redirects. 

To Keep Track of Outgoing Connections

Most web servers maintain extensive information about where visitors came from and how they visited the hosted site in their access logs. They do not, however, keep track of which links were left by visitors. This data can be gathered in a variety of ways. URL redirection is one method.

To Truncate Long URLs with Short Aliases

Long descriptive characteristics that describe data hierarchies, command structures, transaction routes, and session information are frequently included in the URLs of web applications. This approach produces a URL that is unattractive and difficult to remember.

To Have Persistent Aliases for Changing URLs

Even though the content of a page remains the same, the URL may change. As a result, URL redirection can assist users with bookmarks. 

To Avoid Duplicate Form Submissions

The Post/Redirect/Get (PRG) web development design pattern eliminates certain duplicate form submissions if the user clicks the refresh button after submitting the form, giving user agents a more natural interface.

For Device/Geographic Targeting

Client-side redirects or non-cacheable server-side redirects are used for device targeting. Geotargeting is usually done via server-side redirects, but depending on your needs, client-side redirects may be a possibility as well.

To Manipulate Search Engines

Redirects have been used for immoral purposes, such as URL hijacking, to influence search engines.

To Manipulate Visitors

URL redirection is frequently used in phishing attempts to trick users into thinking they're viewing a different website. 

To Remove Referrer Information

When a link is clicked, the browser includes a field called referrer in the HTTP request that specifies the link's source. This field is filled with the current web page's URL, and it will be recorded in the logs of the server that is delivering the external link. The referrer URL should not leave the organization since sensitive sites may include sensitive URLs. A referrer-hiding redirection page may be included in all external URLs. 

How to Create a Redirect

To navigate to the URL Redirections section in Agility CMS, first click the "Settings" link on the left hand global navigation panel.

Step One for redirects in Agility CMS: Click "Settings"

Next, click the "URL Redirections" link on the left hand settings navigation panel.

Step Two for redirects in Agility CMS: Click "URL Redirections"

This will take you to the URL Redirections page.

URL Redirections page in Agility CMS

Click the New button to create a new redirect.

Click 'new' button for redirects in Agility CMS

Enter a value for Origin URL - this represents the URL that you want to redirect to another location. The Origin URL can be a relative or absolute URL.

Example

http://www.mysite.com/mobile

This URL represents an absolute URL, and only full URLs (including that domain) will be matched, while ~/mobile (or /mobile) represents a relative URL and it will be matched to any URL that has that path, regardless of domain.

Enter a value for Destination URL - This represents the URL that you want to redirect the user to.

The Destination URL can be a relative or absolute URL, just like the origin. If you specify a relative path, the domain portion of the URL will remain the same.

Select the HTTP Code - This represents what type of redirect you want to perform.

  • 301 - Permanent - (Recommended) Instructs users and search engines that this redirect is permanent and there's never a reason to have to retry the Origin URL again. These are heavily cached by browsers.
  • 302 - Temporary - Useful when you know that your Origin URL will only redirect temporarily. Instructs users and search engines that this redirect is only temporary and that if the Origin URL is requested again, it should attempt a retry. These are not typically cached by browsers.

Click Save to create the redirect.

Example Redirects

Basic Redirect

Origin URL:

~/page-a

Destination URL:

~/page-b

HTTP Code: 301

This will redirect ALL users on ANY domain from ~/page-a to ~/page-b using a permanent redirect. This is the recommended practice of handling cases where a page's name has changed.

 Wildcard Redirect

Origin URL:

http://www.mysite.com*

Destination URL:

http://mysite.com*

HTTP Code: 301

In this example, we are using a wildcard redirect to redirect all traffic from thewww.mysite.com domain to the mysite.com domain. For example, a request tohttp://www.mysite.com/contact-us will be redirected to http://mysite.com/contact-us

How to Test URL Redirections

Agility CMS makes it easy to test all of your URL redirections so you can identify when they aren't working and take action to fix them or remove them.

Learn how to test your URL Redirections

How to Delete URL Redirections

You can delete one or many URL redirections by selecting them from the grid and clicking Delete.

How to delete URL redirections in Agility CMS

How to Import URL Redirections

Agility gives the user the ability to import URL Redirections. This is very helpful when trying to update multiple URL's at the same time.

You can import URL redirections by formatting an Excel file (.xlsx) file with the following columns:

  • OriginURL
  • OriginLangCodes (optional, semi-colon separated)
  • DestinationURL
  • DestinationLangCode (optional)
  • HTTPCode (301 or 302)

You can Export your items and then modify the excel sheet, or download this sample file to get started.

Example:

How to import URL redirects in Agility CMS

Note

Any existing URLs that do not have changes that are re-imported will be ignored and unchanged.