This project is a continuation of the original URL Tracker, created by Kipusoep.
The URL Tracker makes url management easy. Your visitors will no longer be lost on your website as the URL Tracker watches how your website changes. Page moved or renamed? No problem! The URL Tracker knows this and directs your visitors to the right page. Not only does this provide a nice experience for your visitors, it also helps you maintain your rightful spot at the top in Google (and other search engines). The URL Tracker puts you in control by giving you the means to manage your own redirects. It can be as simple as a redirect from a url to an umbraco page, but you can make it as sophisticated as you like using Regular Expressions. The URL Tracker is an essential tool for content editors who want to migrate to a new Umbraco website, so they can guide their users to the right place.
The URL Tracker is guaranteed to work with SQL Server databases. The URL Tracker does not work with SQL Compact Edition databases.
The URL Tracker is available via NuGet. Visit the URL Tracker on NuGet for instructions on how to install the URL Tracker package in your website.
Once installed, you'll have to actually use it in your request pipeline (Often found in the file Startup.cs
). For the best performance, you should insert the URL Tracker as high in the pipeline as possible. The URL Tracker requires an instantiated umbraco context, so make sure it is inserted after the umbraco context is initialized. We recommend that you insert the URL Tracker like this:
app.UseUmbraco()
.WithMiddleware(u =>
{
u.UseBackOffice();
u.UseWebsite();
// Insert behind 'UseWebsite' to ensure the existance of an UmbracoContext
u.UseUrlTracker();
})
Now build your project and you should be ready to make your visitors happy!
The URL Tracker has several configurable properties that can be changed in appsettings.json:
{
"UrlTracker": {
"IsDisabled": false,
"IsTrackingDisabled": false,
"LoggingEnabled": false,
"IsNotFoundTrackingDisabled": false,
"AppendPortNumber": false,
"HasDomainOnChildNode": false,
"CacheRegexRedirects": true,
"InterceptSlidingCacheMinutes": 2880,
"MaxCachedIntercepts": 5000,
"EnableInterceptCaching": true,
"BlockedUrlsList": []
}
}
Name | Type | Description |
---|---|---|
Is disabled | bool | Set this value to true to completely disable the URL Tracker. The URL Tracker will not intercept any requests nor track any content updates |
Is tracking disabled | bool | Set this value to true to disable tracking of content changes. The URL Tracker will not automatically create redirects when content is updated |
Is not found tracking disabled | bool | Set this value to true to disable tracking of Not Found responses. |
Enable logging | bool | Set this value to true to allow the URL Tracker to write logs to the Umbraco native logger. Most logs from the URL Tracker are written at Debug or Verbose level. |
Append port number | bool | Set this value to true to add a port number behind the host component of a redirect url. This setting is ignored when the application is hosted on the default port 80. |
Has domain on child node | bool | Set this value to true if your website has domains configured on pages that are not in the root of the website. |
Cache regex redirects | bool | Set this value to false to disable caching of regex redirects. By default, all regex redirects are cached in memory to improve performance. |
Intercept sliding cache minutes | int? | Set this value to the time in minutes that all redirects should be cached. By default, all redirects are cached for 2 days. Set to null to cache indefinitely. |
Max cached intercepts | long | Set this value to the amount of intercepts that should be cached by the UrlTracker. This not only includes redirects, but also 200 OK responses, 410 GONE responses and 404 NOT FOUND responses. |
Enable intercept caching | bool | Set this value to false to completely disable redirect caching. |
Blocked Urls List | String array | Add strings to this array that should be blocked from the UrlTracker. The strings in this array will be filtered out and shall never appear as a 404. This is great for things that crawlers search for like wpadmin and prevents the UrlTracker from getting clogged. Keep in mind that the filter works with String.Contains so there is no need to use entire urls. |
Read more in-depth documentation in the URL Tracker wiki.
The URL Tracker is open for contributions. If you want to contribute to the source code, please check out our guide to contributing.
Many people have already contributed to this awesome project:
Made with contributors-img.
Credits from the original developer:
- InfoCaster | Being able to combine 'work' with package development and thanks to colleagues for inspiration.
- Richard Soeteman | Richard came up with the idea for a package which keeps track of URLs of umbraco nodes.
- The uComponents project | For inspiring me to create a single-assembly package solution.