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
-
This one is complicated... canonicals, href lang tags and no index
Bear with me, this is complicated (I REALLY hope one of you comes along and says, no it isn't!) Scenario A client has multiple english pages, as they have a unique product offering in AUS, US, UK, NZ and also have a global site in english. Obviously there is a lot of duplicate content and they have the relevant href lang tags set-up to help Google untangle what should be ranked where. They also have rel-canonical on each page. I've set-up search console for each of the folder structures, i.e. en-us, en-gb, en-au and so on. They have an optimised page for one of their primary keywords, which ranks nowhere for this exact keyword, but this page DOES rank for 40 similar keywords. For the exact keyword, they rank 52nd, and frustratingly, it's the homepage that ranks. We know the correct page is ranking and is indexed because search console tells us so and we see the exact page appear in SERPs for the other 40 keywords. When I look at the en-us site in Search Console, it tells me that the home page is not being indexed, because a rel canonical tag is prioritising an alternative page (probably the global site) - however, the en-us homepage is showing up in rankings for a lot of their important keywords. The site has been live for 6 months and the optimised page for about 3 months. Questions 1. If search console is saying the homepage is not ranking, how is it showing up in SERPs?
Intermediate & Advanced SEO | | Algorhythm_jT
2. Why is the homepage ranking for this important keyword, when there is virtually no mention of the keyword versus the page that is almost perfect according to Moz's on-page grader?
3. Do you need href lang tags AND rel canonical on a page?
4. How long before a new page that is optimised for a keyword take to replace (and hopefully surpass) the homepage?
5. If the US is the most important market, should we guide Google to that fact using rel-canonical? Really appreciate your feedback, hivemind. Thanks0 -
Best server-side xml sitemap generator?
I have tried xml-sitemaps which tends to crash when spidering my site(s) and requires multiple manual resumes which aren't practical for our businesses. Please let me know if any other server-side generators that could be used on multiple enterprise-sized websites exist that could be a good fit. Image sitemaps would also be helpfu.l +++One with multiple starting URLs would help spidering/indexing the most important sections of our sites. Also, has anyone heard of or used Dyno Mapper? This also looks like a good solution for us, but was wondering if anyone has had any experience with this product.
Intermediate & Advanced SEO | | recbrands0 -
Canonical URL Multidomain Geolocation Based
Hey there Mozzers, I have a question on the implementation of the canonical tag. I have 3 TLDs that redirect depending the GeoLocation of the person entering the site. www.example.com www.example.co.uk www.example.com.au The content is the same to all of those. Should I choose 1 of them that all the canonicals should point or should all them point to themselves with the canonical tag?
Intermediate & Advanced SEO | | AngelosS0 -
Do different meta titles & descriptions delete the canonical origin?
Hi, hopefully anyone knows something about this case: There is a canonical tag on site "www.xyz.com**/de_de/" **refering to site "www.xyz.com/de-de/". If the meta title and descriptions are different on both sides - is there a problem that google will not pay attention to the canonical tag? Do both sides need the same title and canonical? Thanx for your answers! Cheers Heiko!
Intermediate & Advanced SEO | | heckert0 -
Google Re-Index or multiple 301 Redirects on the server?
Over a year ago we moved a site from Blogspot that was adding dates in the URL's (i.e.. blog/2012/08/10/) Additionally we've removed category folders (/category, /tag, etc). Overall if I add all these redirects (from the multiple date options, etc) I'm concerned it might be an overload on the server? After talking with the server team they had suggested using something like 'BWP Google Sitemaps' on our Wordpress site, which would allow Google some time to re-index our site. What do you suggest we do?
Intermediate & Advanced SEO | | seointern0 -
Should I optimize for broad or exact match in this case?
Best to illustrate with an example: the term "do girls like chest hair?" has a volume of 210 for exact match, 390 for broad. The term "do girls like hairy guys?" on the other hand, has an exact match volume of 73, but a BROAD match of 8,100. Assuming either is a suitable title for a piece of content and all other things being equal, which page title should I use? As a sort of follow-on, when should one care for broad over exact match?
Intermediate & Advanced SEO | | corp08030 -
How to Specify Canonical Link Element for Better Performing?
I read Google webmaster centeral's blog post and help article about rel="canonical" which was compiled by Matt. http://googlewebmastercentral.blogspot.com/2009/02/specify-your-canonical.html http://www.google.com/support/webmasters/bin/answer.py?answer=139394 I am working on eCommerce website and found too many duplicate pages with same product as follow. 1. www.lampslightingandmore.com/50_62_10133/java-bronze-floor-lamp-with-walnut-shade.html
Intermediate & Advanced SEO | | CommercePundit
2. www.lampslightingandmore.com/48_10133/java-bronze-floor-lamp-with-walnut-shade.html
3. www.lampslightingandmore.com/48_55_10133/java-bronze-floor-lamp-with-walnut-shade.html
4. www.lampslightingandmore.com/48_57_10133/java-bronze-floor-lamp-with-walnut-shade.html
5. www.lampslightingandmore.com/50_10133/java-bronze-floor-lamp-with-walnut-shade.html
6. www.lampslightingandmore.com/50_56_10133/java-bronze-floor-lamp-with-walnut-shade.html
7. www.lampslightingandmore.com/50_63_10133/java-bronze-floor-lamp-with-walnut-shade.html
8. www.lampslightingandmore.com/63_10133/java-bronze-floor-lamp-with-walnut-shade.html
9. www.lampslightingandmore.com/68_10133/java-bronze-floor-lamp-with-walnut-shade.html
10. www.lampslightingandmore.com/68_58_10133/java-bronze-floor-lamp-with-walnut-shade.html
11. www.lampslightingandmore.com/68_59_10133/java-bronze-floor-lamp-with-walnut-shade.html I have consider 1st product as a primary product and set following rel canonical tag on remaining products. Primary product also contain following rel canonical tag. This was my experience to set canonical tag. But, I am not able to see any improvement on crawling. I was in that assumption due to duplication Google did not crawled my pages. But, Now what is problem with it? How can I fix it and specify proper canonical link element for better crawling? Note: I am working to compile unique content on each product pages and make it live very soon.0