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
-
Canonical - unexpected page ranking
We are getting good ranking for an unexpected page, rathewr than the one we were trying to get ranking for. Should we put a canonical on the 'unexpected page' to the page we would like to receive the ranking for - or do we risk losing the ranking? Any suggestions welcomed. Ian
Intermediate & Advanced SEO | | Substance-create0 -
Question on Indexing, Hreflang tag, Canonical
Dear All, Have a question. We've a client (pharma), who has a prescription medicine approved only in the US, and has only one global site at .com which is accessed by all their target audience all over the world.
Intermediate & Advanced SEO | | jrohwer
For the rest of the US, we can create a replica of the home page (which actually features that drug), minus the existence of the medicine, and set IP filter so that non-US traffic see the duplicate of the home page. Question is, how best to tackle this semi-duplicate page. Possibly no-index won't do because that will block the site from the non-US geography. Hreflang won't work here possibly, because we are not dealing different languages, we are dealing same language (En) but different Geographies. Canonical might be the best way to go? Wanted to have an insight from the experts. Thanks,
Suparno (for Jeff)1 -
How to deal with canonicals on dup product pages in Opencart?
So I have a seriously large amount of duplicate content problems on my Opencart site, and I've been trying to figure out the best way to fix them one by one. But is there a common, easy way of doing this? Because frankly, it is a nightmare otherwise. I bought an extension which doesn't appear to work (http://www.opencart.com/index.php?route=extension/extension/info&extension_id=20468&utm_source=ordercomplete&utm_medium=email&utm_campaign=wm), so now I'm at a loss.
Intermediate & Advanced SEO | | moon-boots0 -
Canonical Question: Root Domain Geo Redirects to SubFolder.
Howdy, Working on a larger eComm site that 302s you based on your location. With that in mind should I canonicalize the final page. domain.com => 302 => domain.com/us/, domain.com/fr/, etc... (Should these all have a canonical pointing to the root domain.com?
Intermediate & Advanced SEO | | blake.runyon0 -
Canonical code set up correctly?
Please let me know if this makes sense. I have a very limited knowledge of technical SEO but I am almost positive that my web developer did something wrong. I have a wordpress blog and he did add canonical code to some of the pages. However he directs the site to the same URL! Does this mean that the canonical code is setup incorrectly and actually harming my SEO performance. Also if I have one webpage with just the first paragraph of a blog post I wrote and a completely seperate page for the blog post itself, could this be considered duplicate content? Thanks!!
Intermediate & Advanced SEO | | DR700950 -
Canonicals: use when page has same listings, but displayed very differently?
Say you have a listing of movies. In that listing, there are 5 different view types. One has the scenes broken out. Another has only the box covers. Two of the views have movie descriptions, but others don't. Still, the listings themselves are the same, and you only want the default view to be indexed. Is it appropriate to use canonicals in this case? The alternative is to noindex the other views, but the site already has rankings and deep links. If Google does see the pages as unique and we apply a canonical, could we be penalized or would they merely ignore it?
Intermediate & Advanced SEO | | LahomaManagement0 -
Best server-side sitemap generators
I've been looking into sitemap generators recently and have got a good knowledge of what creating a sitemap for a small website of below 500 URLs involves. I have successfully generated a sitemap for a very small site, but I’m trying to work out the best way of crawling a large site with millions of URLs. I’ve decided that the best way to crawl such a large number of URLs is to use a server side sitemap, but this is an area that doesn’t seem to be covered in detail on SEO blogs / forums. Could anyone recommend a good server side sitemap generator? What do you think of the automated offerings from Google and Bing? I’ve found a list of server side sitemap generators from Google, but I can’t see any way to choose between them. I realise that a lot will depend on the type of technologies we use server side, but I'm afraid that I don't know them at this time.
Intermediate & Advanced SEO | | RG_SEO0 -
Canonical Tag for Pages with Less Content
I am considering using a cross-domain canonical tag for pages that are very similar but one has less content than the other. The domains are geo specific, so for example. www.page.com - with content xxx, yyy, zzz, and www.page.fr with content xxx is this a problem because while there is clearly duplicate content here the pages are not actually significantly similar since there is so much less content on one page than the other?
Intermediate & Advanced SEO | | theLotter0