Commit 94b3a0d
committed
Enforce canonical redirect
Search engines and many analytic tools use case sensitive URLs, and can get fussy about inconsistencies in casing. Best case, this can complicate reporting by having multiple versions of the same page; worst case, it can impact performance due to competing content at two different URLs.
The `GetWebPath()` URL is already used for the `SitemapController`, and most implementations also use it for the canonical URL in their HTML metatags.
Establishing a redirect early on helps ensure that indexes only maintain the canonical URL.
There may be scenarios where this would be better handled as an option, particularly for well-established sites who may have had a casing mismatch with their canonical URL, as redirecting a large number of pages simultaneously can cause a temporary hit to SEO. As we have high visibility into current implementations of OnTopic, that's not an immediate concern, though, and if it is we can revisit making this configurable.
For now, however, we don't have a standard way of relaying configuration variables to e.g. attributes, so I am reluctant to implement a fix that relies on an ad hoc method of establishing such preferences. In a future release of OnTopic, we'll likely standard how these types of preferences can be stored and retrieved from the `ITopicRepository` (e.g., via a `GetConfigurationValue()` method or perhaps an extension method on `Topic`) and can reevaluate this then.1 parent 69dff49 commit 94b3a0d
1 file changed
Lines changed: 12 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
140 | 140 | | |
141 | 141 | | |
142 | 142 | | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
143 | 155 | | |
144 | 156 | | |
145 | 157 | | |
| |||
0 commit comments