We are using AEMaaCS. We have an requirement to add canonical URL to PDFs. Please suggest me how to add it through dispatcher configuration.
Solved! Go to Solution.
Topics help categorize Community content and increase your ability to discover relevant content.
Views
Replies
Total Likes
you can write a rewrite rule matching you dam asset path. The rule will add a Link header to the response, with the value of the header being the canonical URL of the PDF.
Something like
Header set Link 'FILENAME; rel="canonical"'
Hi @DivyaT
You can try by adding the below snippet as part of the rewrite rules
In the dispatcher module you can use "/dispatcher/src/conf.d/rewrites/rewrite.rules" to add the changes
RewriteRule ([^/]+)\.pdf$ - [E=FILENAME:$1]
<FilesMatch "\.pdf$"> Header add Link '<http://www.example.com/download/%{FILENAME}e>; rel="canonical"'
</FilesMatch>
Also please refer this below link
Hope this helps
you can write a rewrite rule matching you dam asset path. The rule will add a Link header to the response, with the value of the header being the canonical URL of the PDF.
Something like
Header set Link 'FILENAME; rel="canonical"'
@DivyaT Did you find the suggestions from users helpful? Please let us know if more information is required. Otherwise, please mark the answer as correct for posterity. If you have found out solution yourself, please share it with the community.
Views
Replies
Total Likes
Views
Likes
Replies