Managing redirects and Advanced URL Management in DNN

Overview

Redirects are commonly used in DNN environments when you want to direct a user to a specific URL or page. Knowing how to set up redirects in the Advanced URL Management and being aware of the settings and limitations can help you answer questions regarding DNN redirections.

 

Prerequisites: 

  

Introduction

What is the Advanced URL Management feature in DNN?

When a page URL changes, it's critical to "redirect" search engines from the old URL to the new one. Advanced URL Management helps you automate and customize how your site handles URL redirects.

Proper management of redirects guarantees that a search engine never encounters an invalid (HTTP 404) page on your site.

These 404 errors can hurt your position in organic search results. Without Advanced URL Management, redirect rules are maintained manually and prone to human error.

 

What Is a Redirect?

A redirect is a way to send both users and search engines to a different URL from the one they initially requested. All redirects return a specific code, and each code means a different type of redirect:

 

301 Moved Permanently/Temporary Redirect

  • This is known as a permanent redirect and is used to indicate to search engines that the originating URL has permanently moved to a new URL.

 

302 Found

  • A 302 redirect is a server-side redirect that redirects users from URL A to URL B while signaling to search engines that URL A's content has been temporarily moved to URL B.

 

There are more redirect codes, but the above two are the most common to recognize.

 


 

Description

How Does DNN Handle Redirects?

In DNN, a redirect on a page can either be automatically created via a system-generated URL or manually created by defining them through a page setting.

 

There are a couple of scenarios where a URL will be automatically generated:

 

  1. If the name of the page has been changed, a new URL would be created to match the page name, and the old page URL would be created as a 301 redirect to redirect users that would visit this old page.

 

  1. If the page was moved to a different page hierarchy, the application creates a redirect similar to scenario #1. For example, if a page were moved from ParentPage/Page to OtherPage/Page, the application would generate a redirect to direct users from ParentPage/Page to OtherPage/Page.

    All of these settings are handled in the Page Settings > Advanced > SEO.

    • Site Alias: Select the alias for the page to use a specific alias.
    • URL Path: Specify the path for the URL. This will determine the URL of the page. Do not enter http:// or the site alias. 
    • URL Type: Select 'Active' or 'Redirect'.
      • 'Active' means the URL will be used as the URL for the page and will return an HTTP status code of 200.
      • 'Redirect' means the entered URL will be redirected to the Active URL for the current page.
    • Page Header Tags: Enter any tags (i.e., META tags) that should be rendered in the "HEAD" tag of the HTML for this page.
    • Sitemap Priority: Enter the desired priority (between 0 and 1.0). This helps determine how this page is ranked in Google with respect to other pages on your site (0.5 is the default).
    • Allow Indexing: This setting controls whether search crawlers should index a page. It uses the INDEX/NOINDEX values for the ROBOTS meta tag. This includes robot search crawlers and the DNN search crawler.

 


 

Types of Redirects

There are a few types of features that cause redirects. If you encountering a redirect, it is likely the cause of the following:

 

DNN Specific Redirects 

These are redirects using the functionality built into the DNN application:

  • Portal Aliases
    • There is a function in the Portal Alias Settings (Settings > Site Settings > Site behavior > Site Aliases) where you can set the Portal Alias Mapping mode:
      • Canonical - Adds a Canonical tag to the DOM to let search engines know to use the Canonical URL. The other URLs in the alias list are still accessible.
      • Redirect - Redirects all the URLs in the list to the primary alias.
    • This is mainly stored in the PortalAlias table.
    • This could also be found in the PortalSettings table with the setting name "PortalAliasMapping."

 

  • Tab URLs (AUM - Advanced URL Management)
    • Tab URLs are the URLs that are set for a specific page. The settings for this can be found in the Page Settings > Advanced > SEO.
      • Automatic (System) generated URLs - These redirect URLs are automatically generated by the DNN application if a page is moved or renamed.
      • Manual URLs - A user manually sets these URLs with either a redirect 301 or active 200.
    • This is stored in the TabURLs table. The Tabs table also has a column, TabPath, which shows the active URL.

 

  • AUM Regular Expressions
    • These regular expressions are set in place to allow basic DNN functionality to function. If you were to see any issues with redirection in basic DNN functionality, it is best to check here if they are using the default values.
    • This is set in Settings > SEO > URL Management > Expressions.

 

  • Page Link Setting
    • This setting is defined in the Page Settings > Page Type, where you can set the page to redirect to an existing DNN page or an external URL. This is easy to determine because you will instantly be redirected while accessing the main URL through the navigation bar.

 

  • Redirect after login/log out/registration
    • There are a few settings that will redirect the user after a certain action.
      • Redirect after login - Found in Settings > Security > Login Settings > Basic Login.  
        • This will redirect the user to a specific page after login.
      • Redirect after log out - Found in Settings > Security > Login Settings > Basic Login. 
        • This will redirect the user to a specific page after logging out.
      • Redirect after registration - Found in Settings > Security > Member Accounts > Registration Settings.
        • This will redirect the user to a specific page after the user completes the account registration.

 

  • Default Pages
    • Not entirely a redirect, but these settings will send the user to a specific location linked to DNN functionality. This can be found in Settings > Site Settings > Site Behavior > Default Pages. This data is stored in the PortalLocalization table.

 


 

IIS Redirects/Rewrites

These redirects are coded either from the IIS UI or the web.config file. These redirects occur before the DNN specific redirects.

 

  • A redirect is a 301/302/303 request, where the application will redirect the request to a specific URL. A rewrite substitutes the request with a different URL, i.e., the resource being sent is the same, but the URL is changed.
  • Users can utilize IIS rewrites when they would like to redirect the request before it hits the DNN application.
  • There are two ways to set a rewrite:
    • IIS - For IIS, it is the URL rewrite module.
    • Directly in the web.config file - You can see the rewrite rules in the web.config that have been defined under the <rewrite> tag. 
  • Knowledge of regular expressions is useful when building these rewrites as you can specify and filter the requests and as well add conditional rules.

 

It is recommended that you review the URL Rewrite Module Configuration Reference article for more in-depth information regarding IIS rewrites. 

 


 

Other Redirects

These are redirects for everything else such as custom module redirects or HTTP or JavaScript client-side redirects:

 

  • JavaScript & Custom module
    • Redirects can be executed by JavaScript, or via a custom module. This can be verified by testing with the default skin or moving the custom module.

 

  • Child Portal Absolute URLs
    • This is a redirection occurring between portals causing the user to be logged out.
      • This occurs when the user is only authenticated in the child portal, and at some point, a resource will be pulled from the parent portal where the user is not authenticated, and it kills the cookie. This will not occur for host users as they have access to all portals.

 

  • Login.aspx and other web.config settings
    • This redirection can be set in the web.config file where you can route the request to a specific page (Login.aspx or 404 error page).

 

Common Usage

Restrict access to page by through a IIS Rewrite rule

When you would like to restrict access to a certain page but would not want to use DNN permissions, you can implement an IIS rewrite rule that restricts access.

 

Related Articles

Attachments

Comments

0 comments

Please sign in to leave a comment.