Which exact Umbraco version are you using? For example: 9.0.1 - don't just write v9
9.5.0
Bug summary
Currently, content is routed/rendered on more than just the URLs that are visible in the back-office. This means every site will have duplicate content issues, which should really be avoided (e.g. we all want the correct URL indexed and shown in search results).
Specifics
No response
Steps to reproduce
On a clean Umbraco install using the Starter Kit, the contact page is available on the following URL:
But also on the following URLs:
/contact - without trailing slash (this would become the actual URL when Umbraco:CMS:RequestHandler:AddTrailingSlash is set to false though)
/Contact/ - using a different casing (could be any casing difference, e.g. /CONTACT/, /cOnTaCt/, etc.)
Next, add an extra language (e.g. Dutch) and configure the following domains on the Home page (below Culture and Hostnames):
This shows the following URLs (including an identical/duplicate absolute URL, as the current base URL is https://localhost:44377/, but that's a different issue):
Besides the URLs without a trailing slash or different casing, the contact page is still available on /contact/, which uses the default language. You can check this by rendering the current language in the master template using e.g. <html lang="@Model.GetCultureFromDomains()"> and change the default language to Dutch.
Expected result / actual result
Route matching should be more strict by ensuring:
trailing slashes aren't removed or added from URLs;
URLs are treated as case sensitive (not just lowercase, as you could manually configure an uppercase URL using umbracoUrlName);
the domain is required in the URL (when configured).
Either the strict matching should be explicitly enabled to keep backwards compatibility and/or you should be able to configure whether you want to render the content (existing behavior), return a 404 or redirect to the actual/canonical URL.
Returning 404s for URLs without trailing slashes or a different casing would make most sense. For missing domains, it would be best to redirect to the correct/canonical URL instead, preferably based on the users preferred languages (from the Accept-Language browser header) and fallback to the default language configured in Umbraco. This would mean that:
/en/contact and /en/CONTACT/ would return a 404;
/contact/ would redirect to either /en/contact/ or /nl/contact (and / to /en/ or /nl/).
I can reproduce this and agree, putting this up for grabs for now 👍
Worth noting that this would be massively breaking, and thus would need to be for V13 (or later)
Which exact Umbraco version are you using? For example: 9.0.1 - don't just write v9
9.5.0
Bug summary
Currently, content is routed/rendered on more than just the URLs that are visible in the back-office. This means every site will have duplicate content issues, which should really be avoided (e.g. we all want the correct URL indexed and shown in search results).
Specifics
No response
Steps to reproduce
On a clean Umbraco install using the Starter Kit, the contact page is available on the following URL:
But also on the following URLs:
/contact
- without trailing slash (this would become the actual URL whenUmbraco:CMS:RequestHandler:AddTrailingSlash
is set tofalse
though)/Contact/
- using a different casing (could be any casing difference, e.g./CONTACT/
,/cOnTaCt/
, etc.)Next, add an extra language (e.g. Dutch) and configure the following domains on the Home page (below Culture and Hostnames):
This shows the following URLs (including an identical/duplicate absolute URL, as the current base URL is
https://localhost:44377/
, but that's a different issue):Besides the URLs without a trailing slash or different casing, the contact page is still available on
/contact/
, which uses the default language. You can check this by rendering the current language in the master template using e.g.<html lang="@Model.GetCultureFromDomains()">
and change the default language to Dutch.Expected result / actual result
Route matching should be more strict by ensuring:
umbracoUrlName
);Either the strict matching should be explicitly enabled to keep backwards compatibility and/or you should be able to configure whether you want to render the content (existing behavior), return a 404 or redirect to the actual/canonical URL.
Returning 404s for URLs without trailing slashes or a different casing would make most sense. For missing domains, it would be best to redirect to the correct/canonical URL instead, preferably based on the users preferred languages (from the
Accept-Language
browser header) and fallback to the default language configured in Umbraco. This would mean that:/en/contact
and/en/CONTACT/
would return a 404;/contact/
would redirect to either/en/contact/
or/nl/contact
(and/
to/en/
or/nl/
).