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
-
Mobile Canonical Tag Issue
Hey so, For our site
Intermediate & Advanced SEO | | ggpaul562
we have the desktop version: www.site.com/product-name/product-code/ The mobile version www.site.com/mobile/product-name/product-code So...on the desktop version we'd have the following.. | | Now my question is, what do we do as far as canonicals on the actual mobile URL? Would it be this? | |
| | OR are we NOT supposed to have mobile canonical tags whatsoever since we've already added "rel alternate" ? Would like some clarificaiton. | | |0 -
Can Googlebots read canonical tags on pages with javascript redirects?
Hi Moz! We have old locations pages that we can't redirect to the new ones because they have AJAX. To preserve pagerank, we are putting canonical tags on the old location pages. Will Googlebots still read these canonical tags if the pages have a javascript redirect? Thanks for reading!
Intermediate & Advanced SEO | | DA20130 -
Internal Linking from Menu or body text or both with exact match keyword?
I used to have my menu link to every page with my exact match keywords. I am a Magician and have pages for each county / town so I had a link to /magician-hampshire with the anchor text Magician Hampshire in the menu. I recently had my website updated and the developer told me this was very spammy have a menu that said Magician Hampshire, Magician Surrey, Magician Berkshire He suggested that I should now have a menu structure that says Areas Covered>Hampshire - Surrey - Berkshire etc.Google will know my website is about a magician and relate the two together. Is this correct or should I revert my menu back to anchor text of Magician (County) I am running wordpress and he said the title attribute can say Magician Hampshire but the Visible text is for the user and not Google. I also use the technique of doing site:rogerlapin.co.uk magician hampshire and then seeing the top 10 pages google has for me and placing a text link from each of these pages in the body text. When doing link analysis I now see I have two links to each page but understand that google will only account for the first one (from the menu) Questions:
Intermediate & Advanced SEO | | rnperki
Should I link to every main page from the Menu with the exact anchor text?
Does google only take into account the first link to a page it discovers?
Will it associate a link to a page with just the text of the county (Berkshire) to be related to Magicians in Berkshire as that is what the page is about? A few years ago I used to have at the bottom of each page Magician Hampshire | Magician Surrey | Magician Berkshire | Magician Sussex links - and to date a a lot of other Magicians employ this same technique. I was told google would slap them for it but so far it has not and it seems to be working for them. Many Thanks Roger http://www.rogerlapin.co.uk0 -
Rel=canonical an iframed version of the same website?
My issue is that we have two websites with the same content. For the sake of an example lets say they are: jackson.com jacksonboats.com When you go to jacksonboats.com, the website is an iframed version of jackson.com. However all of the companies email addresses are example@jacksonboats.com so a 301 is not possible. What would be the best way to forward over the link juice from jacksonboats.com to jackson.com? I'm thinking a rel=canonical tag, but I wanted to ask first. Thanks,
Intermediate & Advanced SEO | | BenGMKT0 -
Canonical url question
i just search seomoz tooll it say duplicate content for www.mysite.com and www.mysite.com/index.php should i use canonical url for this ? is yes then is this right ?
Intermediate & Advanced SEO | | constructionhelpline0 -
Can I use rel=canonical and then remove it?
Hi all! I run a ticketing site and I am considering using rel=canonical temporary. In Europe, when someone is looking for tickets for a soccer game, they look for them differently if the game is played in one city or in another city. I.e.: "liverpool arsenal tickets" - game played in the 1st leg in 2012 "arsenal liverpool tickets - game played in the 2nd leg in 2013 We have two different events, with two different unique texts but sometimes Google chooses the one in 2013 one before the closest one, especially for queries without dates or years. I don't want to remove the second game from our site - exceptionally some people can broswer our website and buy tickets with months in advance. So I am considering place a rel=canonical in the game played in 2013 poiting to the game played in a few weeks. After that, I would remove it. Would that make any sense? Thanks!
Intermediate & Advanced SEO | | jorgediaz0 -
What is the proper syntax for rel="canonical" ??
I believe the proper syntax is like this [taken from the SEOMoz homepage]: However, one of the sites I am working on has all of their canonical tags set up like this: I should clarify, not all of their canonicals are identical to this one, they simply use this naming convention, which appears to be relative URLs instead of absolute. Doesn't the entire URL need to be in the tag? If that is correct, can you also provide me with an explanation that I can give to management please? They hate it when I say "Because I said so!" LOL
Intermediate & Advanced SEO | | danatanseo0 -
Canonical vs noindex for blog tags
Our blog started to user tags & I know this is bad for Panda, but our product team wants use them for user experience. Should we canonizalize these tags to the original blog URL or noindex them?
Intermediate & Advanced SEO | | nicole.healthline0