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
-
How to de-index a page with a search string with the structure domain.com/?"spam"
The site in question was hacked years ago. All the security scans come up clean but the seo crawlers like semrush and ahrefs still show it as an indexed page. I can even click through on it and it takes me to the homepage with no 301. Where is the page and how to deindex it? domain/com/?spam There are multiple instances of this. http://www.clipular.com/c/5579083284217856.png?k=Q173VG9pkRrxBl0b5prNqIozPZI
Technical SEO | | Miamirealestatetrendsguy1 -
Why is "Article 1 - x of y" showing up in this SERP?
Does anybody have an explanation why this is showing up in the SERP? Ju3VYsW.png
Technical SEO | | jmueller0 -
Does rel="canonical" support protocol relative URL?
I need to switch a site from http to https. We gonna add 301 redirect all over the board. I also use rel="canonical" to strip some queries parameter from the index (parameter uses to identify which navigation elements were use.) rel="canonical" can be used with relative or absolute links, but Google recommend using absolute links to minimize potential confusion or difficulties. So here my question, did you see any issue using relative protocol in rel="canonical"? Instead of:
Technical SEO | | EquipeWeb0 -
Will a google map loaded "on scroll" be ignored by the crawler?
One of my pages has two Google maps on it. This leads to a fairly high keyword density for words like "data", "map data" etc. Since one of the maps is basically at the bottom of the page I thought of loading it "on scroll" as soon as its container becomes visible (before loading the map div should be empty). Will the map then still be craweld by google (can they execute the JS in a way that the map is loaded anyways?) or would this help to reduce the keywords introduced by the maps?
Technical SEO | | ddspg0 -
Why am I getting rel= canonical?
I'm getting 14 rel=canonical tags on my site. Could someone offer me an insight as to this is happening? http://cool-invent.com Thanks, Lorraine
Technical SEO | | coolinvent0 -
Would you advise or not to include a sites name at the end of each title tage? Example "Top 3 things to do in New York | yoursite.com"
Having a discussion on if we should include our domain at the end of each site page. Re read over the following pages and question remove the brand to keep under 70 characters? or Shorten the page Title before the brand? Let the title exceed 70 characters? What is your thoughts?
Technical SEO | | Harley2g0 -
Rel=canonical for similar (not exact) content?
Hi all, We have a software product and SEOMOZ tools are currently reporting duplicate content issues in the support section of the website. This is because we keep several versions of our documentation covering the current version and previous 3-4 versions as well. There is a fair amount of overlap in the documentation. When a new version comes out, we simply copy the documentation over, edit it as necessary to address changes and create new pages for the new functionality. This means there is probably an 80% or so overlap from one version to the next. We were previously blocking Google (using robots.txt) from accessing previous versions of the sofware documentation, but this is obviously not ideal from an SEO perspective. We're in the process of linking up all the old versions of the documenation to the newest version so we can use rel=canonical to point to the current version. However, the content isn't all exact duplicates. Will we be penalized by Google because we're using rel=canonical on pages that aren't actually exact duplicates? Thanks, Darren.
Technical SEO | | dgibbons0 -
Moz Crawl Reporting Duplicate content on "template" styled pages
We have a lot of detail pages on our site that reference specific scholarships. Each page has a different Title and Description. They also have unique information all regarding the same data points. The pages are displayed in a similar structure to the user so the data is easy to read. My problem is a lot of these pages are being reported as duplicate content when they certainly are not. Most of them are reported as duplicates when they have the same sponsor. They may have the same contact information listed. These two are being reported as duplicate of each other. They share some data but they are definitely different scholarships. http://www.collegexpress.com/scholarships/adelaide-mcclelland-garden-club-scholarship/9254/ http://www.collegexpress.com/scholarships/mary-wannamaker-witt-and-lee-hampton-witt-memorial-scholarship/10785/ Would it help to add a Canonical for each page to themselves? Any other suggestions would be great. Thanks
Technical SEO | | GeorgeLaRochelle0