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
-
Migrating to new Windows Server
Hello, We are migrating an existing website to a new Windows 2016 Server. Please advise or direct us to any good resources for advice on important configurations for the server primarily with respect to SEO. For example, is it important to ensure Pinging is enabled on server? Or are there good IIS add ons / features we should ensure we use, like URL rewrite? Thank you in advance for your response!
Intermediate & Advanced SEO | | srbello0 -
Canonical vs 301 - Web Development
So I'm having a conversation with the development team at my work and I'm a little tired today so I thought I would ask for other opinions. The currently the site duplicates it's full site by having a 200 show with or without a trailing slash. I have asked for a 301 redirect to with the trailing slash. They countered with having all the rel=canonical be the trailing slash, which I know is acceptable. My issue is that while a rel=canonical is acceptable, since my site has a very high level of competition and a very aggressive link building strategy, I believe that it may be beneficial to have the 301 redirect. BUT, I may be wrong. When we're talking hundreds of thousands of links, I would love to have them directly linked instead of possibly splitting them up between a duplicate page that has a correct canonical. I'm curious to what everyone thinks though....
Intermediate & Advanced SEO | | mattdinbrooklyn1 -
Why isn't the rel=canonical tag working?
My client and I have a problem: An ecommerce store with around 20 000 products has nearly 1 000 000 pages indexed (according to Search Console). I frequently get notified by messages saying “High number of URLs found” in search console. It lists a lot of sample urls with filter and parameters that are indexed by google, for example: https://www.gsport.no/barn-junior/tilbehor/hansker-votter/junior?stoerrelse-324=10-11-aar+10-aar+6-aar+12-aar+4-5-aar+8-9-aar&egenskaper-368=vindtett+vanntett&type-365=hansker&bruksomraade-367=fritid+alpint&dir=asc&order=name If you check the source code, there’s a canonical tag telling the crawler to ignore (..or technically commanding it to regard this exact page as another version of the page without all the parameters) everything after the “?” Does this url showing up in the Search Console message mean that this canonical isn’t working properly? If so: what’s wrong with it? Regards,
Intermediate & Advanced SEO | | Inevo
Sigurd0 -
Crawl Issue Found: No rel="canonical" Tags
Given that google have stated that duplicate content is not penalised is this really something that will give sufficient benefits for the time involved?Also, reading some of the articles on moz.com they seem very ambivalent about its use – for example http://moz.com/blog/rel-confused-answers-to-your-rel-canonical-questionsWill any page with a canonical link normally NOT be indexed by google?Thanks.
Intermediate & Advanced SEO | | fdmgroup0 -
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 -
High level rel=canonical conceptual question
Hi community. Your advice and perspective is greatly appreciated. We are doing a site replatform and I fear that serious SEO fundamentals were overlooked and I am not getting straight answers to a simple question: How are we communicating to search engines the single URL we want indexed? Backstory: Current site has major duplicate content issues. Rel-canonical is not used. There are currently 2 versions of every category and product detail page. Both are indexed in certain instances. A 60 page audit has recommends rel=canonical at least 10 times for the similar situations an ecommerce site has with dupe urls/content. New site: We are rolling out 2 URLS AGAIN!!! URL A is an internal URL generated by the systerm. We have developed this fancy dynamic sitemap generator which looks/maps to URL A and creates a SEO optimized URL that I call URL B. URL B is then inserted into the site map and the sitemap is communicated externally to google. URL B does an internal 301 redirect back to URL A...so in an essence, the URL a customer sees is not the same as what we want google to see. I still think there is potential for duplicate indexing. What do you think? Is rel=canonical the answer? In my research on this site, past projects and google I think the correct solution is this on each customer facing category and pdp: The head section (With the optimized Meta Title and Meta Description) needs to have the rel-canonical pointing to URL B
Intermediate & Advanced SEO | | mm916157
example of the meta area of URL A: What do you think? I am open to all ideas and I can provide more details if needed.0 -
Simple Pagination and Rel Canonical
Hello, I am trying to find a solid solution to this. I think it is simple, but trying to think of a good setup for SEO. If you have a paginated result set, page 1, page 2, page 3, page 4. What i am wondering is, should I point my REL CANONICAL page to Page 1 always, so i'm not loosing power from the first page? Domain structure: www.domain.com/search/[term]/page1/
Intermediate & Advanced SEO | | aactive
www.domain.com/search/[term]/page2/ Should I point all pages to page 1, so I don't get watered down as we go farther into the site? Thoughts?0 -
Should I be using rel canonical here?
I am reorganizing the data on my informational site in a drilldown menu. So, here's an example. One the home page are several different items. Let's say you clicked on "Back Problems". Then, you would get a menu that says: Disc problems, Pain relief, paralysis issues, see all back articles. Each of those pages will have a list of articles that suit. Some articles will appear on more than one page. Should I be worried about these pages being partially duplicates of each other? Should I use rel-canonical to make the root page for each section the one that is indexed. I'm thinking no, because I think it would be good to have all of these pages indexed. But then, that's why I'm asking!
Intermediate & Advanced SEO | | MarieHaynes0