Exact Syntax for Canonical to PDFs for Windows Server
-
Hi There,
I have got in my web several PDFs with the same content of the HTML version. Thus I need to set up a canonical for each of them in order to avoid duplicate content.
In particular, I need to know how to write the exact syntax for the windows server (web.config) in order to implement the canonical to PDF. I surfed the web but it seems I cannot find this piece of info anywhere
Thanks a lot!!
-
Thanks Paul
I had a look at the page, but as I can see it uses headers to identify the response, but the actions are rewrite or redirect. There is a custom response you can use,
for a definitive answer I would ask on iis.net http://forums.iis.net/
Or you could place each pdf in its own folder and place the header on the folder
-
To implement a canonical tag for an individual page/file in IIS, you need to insert a custom response header via an outbound rule in the IIS Rewrite module, not through the web.config.
Sorry I don't have a specific example handy (haven't had to wrassle with IIS in some time). I'll see if I can dig one up.
Meanwhile, here's a link to the relevant section of the general Rewrite Module info in case maybe Alan can suggest the specifics.
Paul
-
Thanks for finding that, I see it says url, but I cant see how that is actually done. All it does it create a web.config in the folder you choose, I found no way of doing it ofr the indervidual file, unless you have only one file per forder
here is the web.config, how to test it works?
<configuration><system.webserver><httpprotocol><customheaders><add name="CononicalUrl" value="Link: http:/domain.com/my.pdf; rel=canonical"></add></customheaders></httpprotocol></system.webserver></configuration>
-
Not according to this doc:
http://technet.microsoft.com/en-us/library/cc753812(v=ws.10).aspx
"Levels
The procedures for configuring HTTP headers can be performed at the following levels in IIS:
-
Web Server
-
Site
-
Application
-
Physical and virtual directories
-
File (URL)"
-
-
My mistake
-
I don't think this can be done in web.config. I don't think it can be done at all.
while you can add a canonical header, to a folder using IIS, you cant add if to a file.
-
He's on a windows server and there is no .htaccess, you use web.config.
-
Hi, I believe your question is answered here via .htaccess file rather than web.config. Moz blog: How To: Advanced rel="canonical" HTTP Headers
Got a burning SEO question?
Subscribe to Moz Pro to gain full access to Q&A, answer questions, and ask your own.
Browse Questions
Explore more categories
-
Moz Tools
Chat with the community about the Moz tools.
-
SEO Tactics
Discuss the SEO process with fellow marketers
-
Community
Discuss industry events, jobs, and news!
-
Digital Marketing
Chat about tactics outside of SEO
-
Research & Trends
Dive into research and trends in the search industry.
-
Support
Connect on product support and feature requests.
Related Questions
-
Using Canonical Attribute
Hi All, I am hoping you can help me? We have recently migrated to the Umbraco CMS and now have duplicate versions of the same page showing on different URLs. My understanding is that this is one of the major reasons for the rel=canonical tag. So am I right in saying that if I add the following to the page that I want to rank then this will work? I'm just a little worried as I have read some horror stories of people implementing this attribute incorrectly and getting into trouble. Thank you in advance
Intermediate & Advanced SEO | | Creditsafe0 -
Should we include a canonical or noindex on our m. (mobile) pages?
According to https://developers.google.com/webmasters/smartphone-sites/details, we should include a canonicalicalize back to our desktop version of the URL, but what if that desktop URL is noindexed? Should the m. version be noindexed as well? Or is it fine to leave it as a canonical?
Intermediate & Advanced SEO | | nicole.healthline0 -
What does this kind of rel="canonical" mean?
It looks like our CMS may not be configured correctly as there is an empty section in the rel="canonical" rel="canonical" href="{page_uri}" /> Will having the above meta tag be harmful to our SEO?
Intermediate & Advanced SEO | | voicesdotcom0 -
Canonical OR redirect
Hi, i've a site about sport which cover matches. for each match i've a page. last week there was a match between: T1 v T2 so a page was created: www.domain.com/match/T1vT2 - Page1 this week T2 host T1, so there's a new page www.domain.com/match/T2vT1 - Page2 each page has a unique content with Authorship, but the URL, Title, Description, H1 look very similar cause the only difference is T2 word before T1. though Page2 is available for a few days, on site links & sitemap, for the search query "T2 T1 match" Page1 appears on the SERP (high location). of course i want Page2 to be on SERP for the above query cause it's the relevant match. i even don't see Page2 anywhere on the SERP and i think it wasn't indexed. Questions: 1. do you think google see both pages as duplicated though the content is different? 2. is there a difference when you search for T1 vs T2 OR T2 vs T1 ? 3. should i redirect 301 Page1 to Page2? consider that all content for Page1 and the Authorship G+ will be lost. 4. should i make rel=canonical on Page1 to Page2? 5. should i let google sort it out? i know it's a long one, thanks for your patience. Thanks, Assaf
Intermediate & Advanced SEO | | stassaf0 -
How canonical url harm our website???
Even though my website has no similar/copied content, i used rel=canonical for all my website pages. Is Google or yahoo make any harm to my SERP's?? EX: http://www.seomoz.org is my site, in that i used canonical as rel="<a class="attribute-value">canonical</a>" href="http://www.seomoz.org" to my home page like that similar to all pages, i created rel=canonical. Is search engine harm my website???
Intermediate & Advanced SEO | | MadhukarSV0 -
Canonical Problems
Hi Guys, There is so much info out there about canonical issues and 301 redirects I'm not sure what to do about my problem. Google webmaster says I have over 2000 duplicate page titles. Google is showing most of my pages in duplicate or triplicate url format. Example: /store/LOVE_OIL_CARIBBEAN_ROSE//store/LOVE_OIL_CARIBBEAN_ROSE/store/love_oil_caribbean_rose/Im using x-cart pro as my cart.When I look at the source code I see each one having a rel=canonical tag with the exact urls you see above. Can someone give me an example of a redirect that I can put in my .htaccess file that would work site wide?I obviously cant go through and 301 this on a page by page basis. It would take a year.Thank You Tim
Intermediate & Advanced SEO | | fasctimseo0 -
How permanent is a rel="canonical"?
We are rolling out our canonicals now, and we were wondering: what happens if we decide we did this wrong and need to change where canonicals point? In other words, how bad of a thing is it to have a canonical tag point to page a for a while, then change it to point to page b? I'm just curious to see how permanent of a decision we are making, and how bad it will be if we screwed up and need to change later. Thanks!
Intermediate & Advanced SEO | | CoreyTisdale0 -
Exact domain or subfolder?
If I am targeting a specific keyword, from an SEO perspective is it better to create a subfolder on a url that has some authority or is it better use the exact domain with no authority? For example, if I want to target the word 'widgets' which is the better choice and why? **Choice 1: ** www.domainwithauthority.com/widgets Note: this domain has 1000 links to it **Choice 2: ** www.widgets.com Note: this is a brand new domain with 0 links
Intermediate & Advanced SEO | | mnipko0