Expand my Community achievements bar.

Dispatcher alert on AEMaaCS - URI not canonical

Avatar

Level 9

Hi,

I was wondering what is the purpose behind the Dispatcher log alert "URI not canonical". I see a lot of those log entries every day for different URLs, some of them might be better optimized for SEO, but some also look completely fine to me, like:
- https://www.example.com/es/products
- https://www.example.com/global/fi/privacy-centre/privacy-notices 

Any experience with this? Should it simply be ignored?

 

Thanks,

Daniel

Topics

Topics help categorize Community content and increase your ability to discover relevant content.

6 Replies

Avatar

Community Advisor

Hi @daniel-strmecki,

The "URI not canonical" alert in AEMaaCS Dispatcher logs usually means the incoming URL doesn’t match the expected canonical structure defined in the Dispatcher configuration. This can affect SEO, caching, and security, so it’s worth fixing, in my opinion.

Even if URLs like https://www.example.com/es/products or https://www.example.com/global/fi/privacy-centre/privacy-notices It looks fine. Here’s why they might trigger the alert: I am guessing that the trailing slashes or the case sensitivity are expected from the config and if you use prefixes like /es or /global/fi, they may need to follow strict patterns in the rules.

adjust your dispatcher rules, may be have an 301 redirect as permanent (recommended),

RewriteCond %{REQUEST_URI} !^/content/dam
RewriteCond %{REQUEST_URI} !^/static
RewriteRule ^/(.*[^/])$ /$1/ [R=301,L]


and address the case sensitivity,

RewriteMap lc int:tolower
RewriteCond %{REQUEST_URI} [A-Z]
RewriteRule ^/(.*)$ ${lc:%1} [R=301,L]

 also, check URL filters if needed,
If you’re still seeing unnecessary alerts, share the exact configurations, and we can figure it out!

-Sravan

Avatar

Level 9

Hi @B_Sravan,

thanks for the hint, we are actually getting a large number of these warnings, but most of them are for URLs that are not valid and return 404. However, I found some examples that look completely fine and return 200.

As we use Sling Mapping, we don't map the short incoming URL to the long AEM URL (/content/...) on the Dispatcher. Is that expected in this case? We only have a few rewrite rules on Dispatcher, for example, to remove trailing slash and .html suffixes.

 

Thanks,

Daniel

Avatar

Community Advisor

Thanks for the update! Regarding Sling Mapping, it's normal for it to route short URLs to longer AEM paths, but it sounds like your current Dispatcher configuration might not be aware of the mapping and could treat URLs that are missing the /content/... path as non-canonical.

In your case, since you're only applying a few rewrite rules like removing trailing slashes and .html suffixes, you might want to ensure that your Dispatcher handles the mapped URLs properly to align with the canonical paths. Here’s what you might consider:

  • Check URL Mappings: Ensure the short URLs (like /es/products) map correctly to their longer /content/paths. This mapping must be reflected in your Dispatcher rules.

  • Rewrite Rules: If necessary, create explicit rewrite rules that capture your short URL structure and map them correctly. If you're not mapping them, a URL with an unmatched structure might get flagged as not canonical.

  • Canonical URL Handling: You might also need to check how your content is linked—ensure the correct canonical URL (/content/...) is defined across your pages.

If you’re already doing this and the warning persists for valid URLs, we might need to explore any advanced caching or pattern mismatches in your existing rules.

- Sravan

Avatar

Level 9

Hi @B_Sravan,

thanks, regarding the points you mentioned:

  • Check URL Mappings: Those URLs map correctly to AEM, but the mapping is not reflected in the Dispatcher rules.
  • Rewrite Rules: As we use Sling Mapping I don't see a point in mapping short to long URLs in two places, this is done in AEM with Sling Mapping.
  • Canonical URL Handling: The links in AEM Author are always using the full path (/content/...) but on Publisher links are short (mapped with resource resolver)

If the reason for this alert is missing the full content path in the URL, then I think we can ignore it in this setup.

 

Daniel

Avatar

Administrator

@daniel-strmecki Did you find the suggestions helpful? Please let us know if you require more information. Otherwise, please mark the answer as correct for posterity. If you've discovered a solution yourself, we would appreciate it if you could share it with the community. Thank you!



Kautuk Sahni

Avatar

Level 9

Hi @kautuk_sahni, I am still looking into this, will post an update once its resolved.