Canonical
-
i have some static webpages in root and wordpress installed in subdirectory , Canonical tag for the whole website was with trailing slash , i stripped the HTML extensions for static webpages but i can't force to add trailing slash to the static webpages so i changed the canonical for html webpages from http://ghadaalsaman.com/articles.html/ to http://ghadaalsaman.com/articles but the Wordpress" http://ghadaalsaman.com/blog/ " still with trailing slash , when i've checked my google webmasters i found that my indexed pages dropped down 100 page !
what should i put in the canonical for the static pages? i tried to strip the slash from wordpress but i failed , so my static webpages canonical with no trailing slash and wordpress with trailing slash .
-
Thanks Dana , can you help me with redirecting non trailing slash to trailing slash at the end , my wordpress is in sub dictionary http://domain.com/blog/
and i have two .htaccess , one in root and one in the wordpress folder.
i tried to solve it by adding that code in the root .htaccess
RewriteEngine On
RewriteBase /blog/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_URI} !(.)/$
RewriteRule ^(.)$ http://ghadaalsaman.com/blog/$1/ [L,R=301]Wordpress give 200 OK with the two versions ( with and without trailing slash ) and that hurts my SEO
Thanks in advanced -
Completely agreed with Dana on this. I recently helped a startup fixing this problem by setting a redirect rule in their nginx configuration to redirect all the URLs with trailing slash to desired version. PFB the required rule if you're using nginx:
rewrite ^/(.*)/$ /$1 permanent;
If you're on LAMP/MAMP/WAMP tech stack, find the apace equivalent of this rule and place it in your apache config file. Hope that helps!
-
Hi there,
Every time I get into the "trailing slash vs. non-trailing slash" discussion with my clients I go back and read this excellent post in the Official Google Webmasters Central Blog by Maile Ohye: https://webmasters.googleblog.com/2010/04/to-slash-or-not-to-slash.html
Problem for SEO: Both URLs are producing 200 OKAY status codes, resulting in duplicate content. This can interefere with crawl efficiency and fragments link equity.
Solution: Ideally, rather than relying on canonical tags to achieve what you want, 301-redirect the non-preferred versions of your URLs to the preferred version. Only one URL should return a 200 OKAY status code. The other should 301-redirect. This is a better solution than relying on canonical tags.
Hope that helps!
Dana
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
-
Ecommerce site product reviews, canonicals – which option to choose?
Recently, I discovered that only the first 4 reviews on our product pages are crawled and indexed. Example: http://www.improvementscatalog.com/eucalyptus-deep-seat-furniture-group/253432 I'm assuming it's due to the canonical that's on the product page http://www.improvementscatalog.com/eucalyptus-deep-seat-furniture-group/253432" />. When you click on page 2 of the reviews, the url does not change, but the next batch of reviews appears on the product page. Same with page 3, etc… The problem is the additional pages are not being crawled and indexed. We have to have the canonical on the product page because our platform creates multiple urls for each product page by including each category where the product resides, related link parameters, etc in the product url (example: http://www.improvementscatalog.com/eucalyptus-deep-seat-furniture-group/patio-furniture/outdoor-furniture/253432) – trust me, it gets ugly! I've researched other Moz answers and I've found that there appears to be a couple of ways to fix the issue. Any ideas/help/guidance/examples on the below options is greatly appreciated!!!! Show only 4 reviews on the first page and place the remaining reviews on a new page by themselves (similar to how Amazon does it). However, I would rather keep all of the reviews on the product page if possible. Add page 2, page 3, etc parameters to the url to display the remaining reviews and adding rel=prev/next. If we chose option 2, would each product page have a different canonical? If so, would it create a duplicate content issue since the above-the-fold content, title tag and meta descriptions would all be the same? Also, would you include each additional page in the sitemap? We had a similar issue with our category pages and we implemented the "viewall" in the canonical. Would that work for our reviews? Thanks in advance for your help!
Technical SEO | | Improvements0 -
Rel="canonical" in hyperlink
Inside my website, I use the rel = "canonical" but I do not use it in the but in a hyperlink. Now it is not clear to me if that goes well. See namely different stories about the Internet. My example below link: Bruiloft
Technical SEO | | NECAnGeL0 -
Can I canonical the same page?
I have a site where I have 500+ Page listing pages and I would like to rel=canonical them to the master page. Example: http://www.example.com//articles?p=18 OR http://www.example.com/articles?p=65 I plan on adding this to the section from of the page template so it goes to all pages - When I do this, I will also add the canonical to the page I am directing the canonical. Is this a bad thing? Or allowed?
Technical SEO | | JoshKimber0 -
Canonical Advice - ?
Hi everyone, I have a bit of problem with duplicate content on a newly launched site and looking for some advice on which pages to canonicalize. Our legacy site had product "information" pages that now 301 to new product information pages. The reason for the legacy having these pages (instead of pages where you can purchase) is because we used our vendors "cart link", which was an iframe inside the website. So in order to get ranked for these products, we created these pages, that had links to the frame where they could buy. The strategy worked, and we got ranked for our products. Now with the new site, we have those same product information pages, but when you click the link to buy, it goes to a page which now is on our actual site, where you can make the purchase, but this page contains the same basic information, though it looks very different. So my question --- the product "information" pages, are the new 301 homes and are the pages with the rank. The purchase pages are new and have no rank, but are essentially duplicate content. Should I put the canonical link element on the purchase page and tell Google to regard the information pages since those are ranked? It just seems weird to me to direct Google away from the place where people can purchase, however, the purchase pages aren't nearly as "pretty" as the information pages are, and wouldn't be the greatest landing pages. We have an automotive site, and the purchase page you have to enter vehicle information. The information page is nicer, and if the visitor is interested, its just one click to get to that page to buy. What to do here? I am fairly new to Moz, and I couldn't determine whether I am permitted to include an example link from our site of what I am referring to. Is that permitted? Thanks for any help anyone can provide.
Technical SEO | | yogitrout1
Kristin0 -
Canonical URL
Hi there Our website www.snowbusiness.com has a non www version and this one has 398 backlinks. What is the best way of transfering this link value if i establish the www. address as the canonical URL? Thanks, Ben
Technical SEO | | SnowFX0 -
Will rel=canonical work here?
Dear SEOMOZ groupies, I manage several real estate sites for SEO which we have just taken over. After running the crawl on each I am find 1000's of errors relating to just a few points and wanted to find out either suggestion to fix or if the rel=canonical will resolve it as it is in bulk. Here are the problems...Every property has the following so the more adverts the more errors. each page has a contact agent url. all of these create dup title and content each advert has the same with printer friendly each advert has same with as a favorites page several other but I think you get the idea. Help!!! .... suggestions overly welcome Steve
Technical SEO | | AkilarOffice0 -
Notice - canonical tag
I've got several errors pointing to canonical tag, but do not know how to solve.Any help? Rel Canonical Found 6 days ago <dl> <dt>Tag value</dt> <dd>http://www.yougraph.com/</dd> <dt>Description</dt> <dd>Using rel=canonical suggests to search engines which URL should be seen as canonical.</dd> </dl> <a class="more expanded">Minimize</a>
Technical SEO | | nlopes1 -
Canonical solution for query strings?
Greetings, The Hotel company where I'm employed uses query strings in it's url's to track customers. The query strings are integrated into our property management system, and they help identify who we need to pay commissions to, so they aren't going anywhere. While I understand that session variables could have been a better solution, I sort of inherited this problem. The issue I'm running into is that my Webmaster tools picks up these query strings as actual url's. So for instance: www.url.com/index.php?P_SOURCE=WBFQ Seems like a duplicate page of my root, and like wise for all my other pages that use our booking widget. So, Is there a canonical solution to this issue? or would 301/302's be the only solution. Also, we may have 10 different but specific query strings to put into our urls. Would the 301/302 approach cause any server issues for say 10 pages? So 10 pages x 10 access codes = a lot of redirects. Thanks in advance, Cyril
Technical SEO | | Nola5040