XperienceCommunity.UrlRedirection.Base 13.0.13-beta

This is a prerelease version of XperienceCommunity.UrlRedirection.Base.
There is a newer version of this package available.
See the version list below for details.
dotnet add package XperienceCommunity.UrlRedirection.Base --version 13.0.13-beta                
NuGet\Install-Package XperienceCommunity.UrlRedirection.Base -Version 13.0.13-beta                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="XperienceCommunity.UrlRedirection.Base" Version="13.0.13-beta" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add XperienceCommunity.UrlRedirection.Base --version 13.0.13-beta                
#r "nuget: XperienceCommunity.UrlRedirection.Base, 13.0.13-beta"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install XperienceCommunity.UrlRedirection.Base as a Cake Addin
#addin nuget:?package=XperienceCommunity.UrlRedirection.Base&version=13.0.13-beta&prerelease

// Install XperienceCommunity.UrlRedirection.Base as a Cake Tool
#tool nuget:?package=XperienceCommunity.UrlRedirection.Base&version=13.0.13-beta&prerelease                

Kentico 13 URL Redirection Module

This module adds an interface in the CMS to allow a user to edit and manage URL Redirects in one place. The module supports multi-site instances and multi-culture sites (more details below). The source code for this module is included in this repo if you wish to clone and modify it anyway you see fit.

It was originally created by Silver Tech, but it was forked off by HBS and upgraded to 13.

Compatibility

  • .Net Core 3.1 / .Net 5.0 (for KX 13 MVC Core)
  • Kentico Version 13.0.0 or greater

Installation Instructions (Both)

Install the latest version of the XperienceCommunity.UrlRedirection.Admin nuget package on your Kentico installation Install-Package XperienceCommunity.UrlRedirection.Admin

Since this package depends on the Kentico.Xperience.Libraries, this nuget package will install, please make sure to upgrade the Kentico.Xperience.Libraries nuget package to the version that matches your Kentico Solution's hotfix!

Installation (MVC.Net Core)

On your MVC.Net Core Sites, install the XperienceCommunity.UrlRedirection nuget package Install-Package https://nuget.org/packages/XperienceCommunity.UrlRedirection

In your startup's ConfigureServices(IServiceCollection services) method, add: services.AddUrlRedirection();

Also in your startup's Configure(IApplicationBuilder app) method, add: app.UseUrlRedirection(); where you wish to wire up this middleware. I put it before the UseEndPoints myself.

LIMITATIONS/REQUIRED SETUP

IMPORTANT - Please note that there are a few requirements with this module in order to determine the proper domain the redirect should use when the target is a relative path.

Single Site and Single Culture

If your site is a single domain and single culture, you should specify the default visitor culture as the default culture of your site. If this is not set, the redirect will use the request's domain and may default to en-US culture if not determined elsewise.

To do this, follow these steps:

  1. Go to Applications>Configuration>Sites
  2. Edit the site
  3. Select the Culture of your site from the "Visitor Culture" drop down (in this example it is English) Primary Culture Dropdown
  4. Click Save

Single Site and Multiple Cultures - Domain Aliases

If your site is a single site but uses different domain aliases for each culture then you must specify which language each domain if you wish the redirector to use these culture domain aliases when redirecting for the proper culture.

  1. Follow the steps for "Single Site and Single Culture" and set the main domain's culture to your primary culture
  2. Click on Domain aliases in the left hand tabs
  3. For each domain aliases, select the appropriate culture. In this example, de. is German and fr. is French Multiple Cultures Domain Aliases

Module Overview

The Kentico URL Redirection module contains one class, Redirection Table, that is not customizable. The class' fields are as follows:

Field Name Data Type Form Control Descrpiton
RedirectionTableID Integer N/A (Not Editable) Unique ID of the redirection item
RedirectionEnabled bool Checkbox Only enabled redirects will be leveraged in redirection lookups. Uncheck to disable.
RedirectionOriginalURL Text (2000) Text Box URL Alias that will be redirected. Ex: /original-url . You can us {culture} as a placeholder for the culture in your URL, and you can add Query String parameters (coupled with Exact Match) to require a match on query string values additionally.
RedirectionExactMatch bool Check box If true, the Original Url must match exactly, including the query strings and/or hash.
RedirectionTargetURL Text (2000) URL Selector Internal alias or External URL that the Original URL field will be redirected to. Ex: /target-url Ex: https://www.external-domain.com
RedirectionAppendQueryString bool Checkbox If true, any query string parameters the user hits the Origin URL with will be added to the Target URL's listing. Duplications are automatically handled.
RedirectionDescription Long Text Text Area A field that allows a content editor to describe a redirect or enter the purpose of a redirect
RedirectionSiteID Integer Site Selector Drop down list that allows a user to specify which site the redirect is for. Default is the current site the user is on.
RedirectionType Text (3) Drop Down List Allows the user to specify if the redirect is a 301 or 302 redirect.
RedirectionCultures Text (4000) Multiple Choice Allows the user to specify which cultures the redirection should be enabled for. The default selected will be the Cultures available for the current site, although all cultures currently assigned to the site will be shown.
RedirectionCultureOverride Text (10) Drop Down List If set, this redirection will override the user's culture during the redirect. This feature may no longer work on .Net Core sites

The module can be accessed by going to Applications>Custom>URL Redirection.

URL Redirect Settings

In Settings > URLS and SEO > Redirections, there are the following settings:

Name Data Type Form Control Descrpiton
Path Prefixes to Ignore LongText TextArea One per line, any requests with a prefix of any specified will not be processed, useful for speeding up non-page requests
Culture In Url Settings int (enum) Drop down list If your site uses Culture in the URLs, this can be configured to automatically detect and handle cultures through it. Options are None, Prefix, Prefix before Virtual directory, and Postfixed
Culture Query String Param Text Textbox If set, the URL Redirect will honor cultures passed through this query string.
Culture Format (No Alias) int (enum) Drop down list What culture format in the URL your site uses, options are xx-XX and xx (example: en-US or en)

Exact Matches and Hash

Exact Match will match based on the URL and the Query String, but since Hash values are not passed to the server, they will are not tracked for matching.

Overrides

There are 4 interfaces that this tool uses, you can implement your own versions if you wish to customize. The previous Event Hooks have been removed.

Logging

the IUrlRedirectionResultLogger provides you entry points to log results. You can implement your own implementation and hook it up after services.AddUrlRedirection() (ex: services.AddUrlRedirection().AddSingleton<IUrlRedirectionResultLogger, MyCustomUrlRedirectionResultLogger>()). The default one does nothing (no logging).

License

This project uses a standard MIT license which can be found here.

Contribution

Contributions to this module are welcome. All the source files for this module are included and you just need to add the project to a Kentico Web Application solution and you can start editing anything you like.

Submit a pull request to the repo with your code changes as well as an updated ZIP file (if CMS changes were made) and we will review and provide feedback. We will also update the NuGet package to a new version once we approve your changes.

Support

Any bugs can be listed as issues here in GitHub or can be sent to our email tfayas@hbs.net. We will respond as soon as we can.

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (2)

Showing the top 2 NuGet packages that depend on XperienceCommunity.UrlRedirection.Base:

Package Downloads
XperienceCommunity.UrlRedirection

This is for the Kentico Xperience 13 .net Core solution (Site). Must install XperienceCommunity.UrlRedirection.Admin on the administrator site prior to usage. Enables custom 301 and 302 redirects to be created and managed within Kentico Xperience 13. Handles Query String matching/combining/appending, lingual, exact match vs. not, etc. Use IServiceCollection.AddURLRedirection(); and ContainerBuilder.UseURLRedirection(); in your startup to leverage.

XperienceCommunity.UrlRedirection.Admin

Module to manage redirects through the Xperience CMS. This package is for the Admin, not the MVC sites.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
13.0.13 7,042 9/26/2023 13.0.13 is deprecated because it has critical bugs.
13.0.13-beta 99 9/26/2023
13.0.12 5,470 6/28/2023
13.0.11 175 6/28/2023
13.0.10 294 6/21/2023
13.0.9 23,705 5/19/2022
13.0.8 9,263 3/17/2022
13.0.6 1,595 3/14/2022

Add empty constructor for Serializable classes to help with Debugging issue