Rel="canonical" and rewrite
-
Hi,
I'm going to describe a scenario on one of my sites, I was wondering if someone could tell me what is the correct use of rel="canonical" here.
Suppose I have a rewrite rule that has a rule like this:
RewriteRule ^Online-Games /main/index.php
So, in the index file, do I set the rel="canonical" to Online-Games or /main/index.php?
Thanks.
-
Great, thanks a lot!
-
Your example is not a case where you would use canonical links.
Canonical links are useful when you have several pages which are accessible vial individual URLs and do not redirect to a single page, yet they have very similar content.
A great example is a category page in an online store. Quite often, you will find various sorting methods, like price, popularity, etc. These various sorting methods usually add a parameter to the URL, something like "order=price". Yet, the content remains largely the same.
In cases such as above, the different pages should have a canonical reference to the main page.
In your case, you simply need a 301 redirect, that's all.
-
None of the above. If you have a .htaccess file, you need to 301 /main/index.php to OnlineGames. Another option is to tell index.php it can only be called as OnlineGames, or 301 to that directory. The reason is you're pretending that index.php is a directory. You don't want to waste the time of bots crawling the same page twice so just 301 it. You remove the issue entirely and save your crawl budget.
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
-
GSC: Change of Domain Not Processed, Despite Saying "Approved"?
Hi folks, I've just completed a straightforward olddomain -> newdomain migration. All the redirects were done on 7th Feb. I submitted the change of domain request on 7th Feb. All seemed fine - as can be seen in the attached. It's now 19th March and our pals at GSC are still saying that the domain migration is ongoing. I've never had this take so long before; 2-3 days tops. Their results are tanking as I can't geo target and more features in GSC are out of action as it's 'locked' due to this migration (I just get a screen as per the attached). Thoughts? Shall I risk withdrawing the request and starting anew? The old "turn it off and on again"? Thanks! hJXKC
Technical SEO | | tonyatfat0 -
Does the order of results from "site:www.example.com" tell us anything?
Does google rank in order of page authority with "site:www.example.com" or is it random? As most of the results of the first 6 pages for our site are internal search results pages ( eg www.example.com/search/product-results)
Technical SEO | | PaddyDisplays
The fact that search results are index at all is frustrating, they are not linked to internally or externally. The open site explorer does not have any back links for any of the search pages, and I checked the submitted site map and no search urls are submitted, so I don't know how google are finding the search urls. Also tested some of the search urls with aherf and no back links. But since its ranking the search pages ahead of the category(landing) pages with "site:" has me worried that not only are they indexing the urls, but they giving them higher page authority0 -
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 -
I always get this error "We have detected that the domain or subfolder does not respond to web requests." I don't know why. PLEASE help
subdomain www.nwexterminating.com subfolder www.nwexterminating.com/pest_control www.nwexterminating.com/termite_services www.nwexterminating.com/bed_bug_services
Technical SEO | | NWExterminating0 -
How to find original URLS after Hosting Company added canonical URLs, URL rewrites and duplicate content.
We recently changed hosting companies for our ecommerce website. The hosting company added some functionality such that duplicate content and/or mirrored pages appear in the search engines. To fix this problem, the hosting company created both canonical URLs and URL rewrites. Now, we have page A (which is the original page with all the link juice) and page B (which is the new page with no link juice or SEO value). Both pages have the same content, with different URLs. I understand that a canonical URL is the way to tell the search engines which page is the preferred page in cases of duplicate content and mirrored pages. I also understand that canonical URLs tell the search engine that page B is a copy of page A, but page A is the preferred page to index. The problem we now face is that the hosting company made page A a copy of page B, rather than the other way around. But page A is the original page with the seo value and link juice, while page B is the new page with no value. As a result, the search engines are now prioritizing the newly created page over the original one. I believe the solution is to reverse this and make it so that page B (the new page) is a copy of page A (the original page). Now, I would simply need to put the original URL as the canonical URL for the duplicate pages. The problem is, with all the rewrites and changes in functionality, I no longer know which URLs have the backlinks that are creating this SEO value. I figure if I can find the back links to the original page, then I can find out the original web address of the original pages. My question is, how can I search for back links on the web in such a way that I can figure out the URL that all of these back links are pointing to in order to make that URL the canonical URL for all the new, duplicate pages.
Technical SEO | | CABLES0 -
Canonical Question
Our site has thousands of items, however using the old "Widgets" analogy we are unsure on how to implement the canonical tag, and if we need to at all. At the moment our main product pages lists all different "widget" products on one page, however the user can visit other sub pages that filter out the different versions of the product. I.e. glass widgets (20 products)
Technical SEO | | Corpsemerch
glass blue widgets (15 products)
glass red widgets (5 products)
etc.... I.e. plastic widgets (70 products)
plastic blue widgets (50 products)
plastic red widgets (20 products)
etc.... As the sub pages are repeating products from the main widgets page we added the canonical tag on the sub pages to refer to the main widget page. The thinking is that Google wont hit us with a penalty for duplicate content. As such the subpages shouldnt rank very well but the main page should gather any link juice from these subpages? Typically once we added the canonical tag it was coming up to the penguin update, lost a 20%-30% of our traffic and its difficult not to think it was the canonical tag dropping our subpages from the serps. Im tempted to remove the tag and return to how the site used to be repeating products on subpages.. not in a seo way but to help visitors drill down to what they want quickly. Any comments would be welcome..0 -
Is there a work around for Rel Canonical without header access?
In my work as an SEO writer, I work closely with web designers and usually have behind the scenes access. However, the last three clients who hired me have web designers that are not allowing admin access to anyone else (including the clients) outside of their companies/small business. Is there a work around for the Rel Canonical element that usually is placed in the header? I am using All-In-One-SEO plug-in to address part of this issue. Sage advice or discussion on this is appreciated!
Technical SEO | | TheARKlady0 -
Rel Canonical - Wordpress
How do you fix the rel canonical issue on a wordpress site? Is there a quick fix? I have a few notices on my site and am a little confused. Thanks, Jared
Technical SEO | | SaborStyle0