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
-
Is "Above the Fold Content" still a thing?
Many of our pages have the textual content stuffed at the bottom of the page because the manager doesn't think anybody reads it and it is an eyesore to have at the top: http://www.stevinsontoyotawest.com/schedule-service For some light reading here is Google’s official blog talking about content quality:
Technical SEO | | MEllsworth
http://googlewebmastercentral.blogspot.co.uk/2012/01/page-layout-algorithm-improvement.html This references Ads vs Content showing above the fold. However, in our case it has to do with images vs ads and stuffing text at the bottom of pages. Here is a bit of heavier reading. You can do a quick search for "Fold" to see their interpretation.
http://macedynamics.com/research/content-quality-score/ I understand that images are still content, however hardly any of the images have Alt text and they are not even named with keywords so Google really can't distinguish what the page is about through images alone. I'm not about to go through the entire site and add Alt text and rename images because I have much more to do on my plate. So, the questions is: Is stuffing content at the bottom of the page, below all images/inventory/widgets ok to do or should we stick with the eyesore content at the top of the page? Thoughts?0 -
Rel-canonical and meta data
Hey Mozzers, Help please. I am migrating content for a new website (1000's of pages) and am using the canonical tag on a number of pages. For the pages which I am asking Google not to recognise / index as the master version, and in the interests of time do I need to take the time to fill in the meta <title><description> etc each time?</p> <p>Ben</p></title>
Technical SEO | | Bendall0 -
301 redirect: canonical or non canonical?
Hi, Newbie alert! I need to set up 301 redirects for changed URLs on a database driven site that is to be redeveloped shortly. The current site uses canonical header tags. The new site will also use canonical tags. Should the 301 redirects map the canonical URL on the old site to the corresponding canonical for the new design . . . or should they map the non canonical database URLs old and new? Given that the purpose of canonicals is to indicate our preferred URL, then my guess is that's what I should use. However, how can I be sure that Google (for example) has indexed the canonical in every case? Thx in anticipation.
Technical SEO | | ztalk1120 -
Canonical & rel=prev / next changes to website a good idea or not?
Hi all, I decided yesterday to make a load of changes to my website, and today i woke thinking, should i have done that! So below is an example of what i have done (i will try to explain clearly anyway), can you let me know if you think what i have done would harm or help my website in search results etc... ok, so lets take just one category - Cameras And it has the sub categories - box dome bullet it also has other sub categories (which are actually features, but the only way i can show them on my site is by having them as a sub-category with its own static page, and adding the products to these as secondary categories) vandal proof high resolution night vision previously i have it set up so that every single category / sub category / feature had its own static page, with a canonical tag to itself (i.e cameras.html canonical was to cameras.html, vandalproof.html canonical was to vandalproof.html). Any of the categories / sub cats / features that had more than one page were simply not in search results due to the canonical pointing to "Page 1"... What i have now done: Last night i decided to change all this, now for all categories / sub cats / features i have add rel=prev / next where applicable, and removed the canonical from second / third / fourth pages etc, but left the canonical on "page 1". I also removed any keywords from page 2,3,4 etc and changed descriptions to just page "X" + category name. So for example, page one looks like: and page two looks like: I also went a little further (maybe too far) and decided that the features pages would canonicalize back to cameras so for those i now have: Page 1: Page 2: Any advice is welcome on the above, in regards to which way may be better and why, and obviously if anything jumps out as a mistake... Please advise James
Technical SEO | | isntworkdull0 -
Rel="author" showing old image
I'm using http://www.google.com/webmasters/tools/richsnippets to test my rel="author" tag which was successful, but I noticed I wanted to change my image in Google+ as it is not what I want. I changed my image in Google+, it's been over 14 hours now and still not showing the new picture using the RichSnippets tool. I know Google can take a couple weeks at least to show changes in search results, but this RichSnippet tool I thought was immeidate. Am I missing something here or am I just impatient? I want my new photo to show.
Technical SEO | | Twinbytes0 -
Can I "Run Macros" on my own?
I talked to the SEO company I am using and trying to get an understanding of what it is they are doing for me. They told me that one of the most important things they are doing is running macros. Is this something I could learn to do myself? What does it mean? How do I do it? How long does it take?? I have recently been educating myself on SEO and coded my website with metadata titles and descriptions. Is running macros something I can do on my own too? I guess I'd also just like to know what it is.
Technical SEO | | CapitolShine0 -
404 crawl errors from "tel:" link?
I am seeing thousands of 404 errors. Each of the urls is like this: abc.com/abc123/tel:1231231234 Everything is normal about that url except the "/tel:1231231234" these urls are bad with the tel: extension, they are good without it. The only place I can find this character string is on each page we have this code which is used for Iphones and such. What are we doing wrong? Code: Phone: <a href="[tel:1231231234](tel:7858411943)"> (123) 123-1234a>
Technical SEO | | EugeneF0 -
Rel=Canonical being ignored?
Hi all, We have a toys website that has several categories. It's setup such that each product has a primary category amongst the categories within it can be found. For example... Addendum's primary url is http://www.brightminds.co.uk/childrens-toys/board-games/addendum.htm but it can also be found here http://www.brightminds.co.uk/learning-toys/maths-learning/addendum.htm. Hence, in the for that url it has a rel=canonical that points to the first url. For some reason though seomoz ignores this and reports duplicate page content. It doesn't seem to record the canonical tag either. Any ideas what's going on? Thanks, Josh.
Technical SEO | | joshgeake_gmail.com0