We'll create fresh WordPress site with Canonical Attachments installed. You have 20 minutes to test the plugin after that site we'll be deleted.
This plugin was developed to allow canonical tags as response headers to be created via htaccess for attachment files such as pdfs and docs.
The plugin:
The challenge: Analytics software such as Google Analytics, cannot track a user that enters a website via a pdf file in Google search results. Files cannot have a standard canonical tag added in the <head> and instead the canonical tag has to be added via an http header when the file is requested from the server. In order to accomplish this, we need to have an htaccess file listening for a request to that file, and then sending the header.
Expected outcome: PDF files and other attachments will be replaced in search results with the post or page counterparts, and we will be able to measure the traffic to those pages and provide calls to action for downloading the file, submitting contact forms, etc. Note: Canonical tags do not force a search engine to index one url vs. another, but act as a guideline/request to the search engine. As long as the attachment content is similar to the canonical URL, you should have no problem encouraging the search engines to choose the correct version.
Based on the feedback, we hope to continue developing additional features to support user requests. Current future feature ideas include: