Canonical redirects
-
Hello,
I have a quick question: I use wordpress for my website. I have a plugin for translating the website in other languages. Thus, I have 2 versions of urls, one with /en, one without (original languale). This has been seen as duplicate content.
I have been advised that the best to do is to use canonical redirect. Should I use it on the general header.php (the only header I can find in the CMS), or should I redirect each page singularly? I believe the second is the best way, but I can't find headers and txt documents for each page in my FTP.
As well I have seen this post, in which is explained that canonical redirects can be done directly in the general header.php http://www.bin-co.com/blog/2009/02/avoid-duplicate-content-use-canonical-url-in-wordpress-fix-plugin/
Is it true? You have any suggestion?
Thanks!Eugenio
-
Thank you Adam,
Very good answer, thats what I needed
Please let me know if I understood good:
Should I replace the /contact.php in the example to my real address /en/contact?
And basically I should put the below condition. Should I write this code for each url i want to redirect? so that it would be like
if /en/contact, then rel="canonical" /contact
else /contact
if /en/about-us, then rel="canonical" /about-us
else /about-us
etc?
-
Since you are using wordpress you won't have individual pages in your FTP. The only way you could edit something into the individual pages would be each posts edit page on the CMS. However, I don't know if doing that would work since its technically beneath the head.
And yes the canonical redirect can be done in the general header, although personally I would load it as a php IF criteria. In other words you add it to the general header but tell it only to load that if i t is on one of these /en pages. That way you don't have the canonical applied to other pages you actually want, or the main page that it is directing too as that would cause an odd loop for the spiders that I doubt they would respond positively too.
Here you can find a quick sample of working with the PHP if page criteria: http://stackoverflow.com/questions/7997016/if-this-page-show-this-else-show-this
Good luck!
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
-
Redirects, 301's & 404's
I have tons of links that I have had added a redirect to after creating my companies new website. Is it bad to have all these 301s? How do I permanently redirect those links? Also, on Google Search Console it's telling me I have 1,000+ excluded links. Is this bad? Will it negatively affect me? Is this something to do with my sitemap? Any help would be greatly appreciated 🙂
Technical SEO | | sammecooper0 -
Regarding Redirect chain
**Old site urls:- **http://www.giftalove.com/birthday-gifts-5.html **New site urls:- **https://www.giftalove.com/birthday **Old site urls:- **http://rakhi.giftalove.com **New site urls:-**https://www.giftalove.com/rakhi My old site url redirect to new site url but show redirect chain issue. My site redirect A to B to C. Kindly find attached image and guide me what is the best way of redirection. Thanks & Regards Dilip Kumar boxgEpd
Technical SEO | | Packersmove0 -
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 -
Are these redirects damaging my rankings
Hi, just been going through my google webmaster tools and i have found a number of soft 404 errors and was shocked to see these redirects going to my home page. | URL | Response Code | Detected |
Technical SEO | | ClaireH-184886
| --- | --- | --- |<colgroup><col style="width: 45px;"><col style="width: 80px;"><col><col style="width: 120px;"><col style="width: 90px;"></colgroup>
| | 1 | staging1/jupgrade2/component/k2/item/475-gastric-band-hypnotherapy-expert-says-government-are-not-doing-enough-to-fight-obesity | | 7/25/13 |
| | 2 | staging1/jupgrade2/category-menu/item/1068-coronation-street-nick-proposes-to-leanne | | 7/28/13 |
| | 3 | staging1/jupgrade2/category-menu/item/1086-coronation-street-fiz-nearly-gets-tyrone-in-trouble-with-kirsty | | 7/28/13 |
| | 4 | staging1/jupgrade2/category-menu/item/1155-coronation-street-kylie-considers-telling-david-about-her-affair | | 7/28/13 |
| | 5 | staging1/jupgrade2/category-menu/item/1157-coronation-street-fiz-is-worried-when-kirsty-pays-her-a-visit | | 7/28/13 |
| | 6 | staging1/jupgrade2/component/k2/item/750-actress-hilary-duff-is-sued-over-car-accident | | 7/25/13 |
| | 7 | staging1/jupgrade2/component/k2/item/843-what-your-dogs-bottom-scooting-behaviour%E2%80%99-really-meansI would have thought that the developer who upgraded my site would have either had these blocked or directed them to the correct page. i am now guessing that there are going to be hundreds of these appearing and would like some serious advice.normally with old pages i would have them going to the relevant articles or pages but it seems the developer has redirected hundreds of these to my home page, which i guess is going to confuse google. i would like to know if this will confuse google have all these pages going to my home page.i have tried to find out where the developer in my site has redirected the pages as they are not in my htaccess file, i use joomla.can anyone let me know what i should be doing with these to solve the problemmany thanks |0 -
Rel="canonical" again
Hello everyone, I should rel="canonical" my 2 languages website /en urls to the original version without /en. Can I do this from the header.php? Should I rel="canonical" each /en page (eg. en/contatti, en/pagina) separately or can I do all from the general before the website title? Thanks if someone can help.
Technical SEO | | socialengaged0 -
Code for redirect
What is the code to redirect www.xyz.com/abc where abc is a folder to www.xyz.com/abc.html
Technical SEO | | seoug_20050 -
Joomla 301 redirects
hi i am using joomla sef404 and i have 7000 not found pages in my webmaster google tool page. the trouble is i got rid of a lot of pages and also components so now i am left with loads of not found pages. what i want to try and do is to create 301 redirects so that i do not lose page rank. can anyone please let me know how to do this step by step please
Technical SEO | | ClaireH-1848860 -
301 Redirects
Last year we merged 3 websites into 1 website and launched the new site in February. When developing the new site I created 301 redirects for all the pages from the old sites to the new site. Unfortunately when the new website was created the URLs were not optimised for search engines. I now need to optimised the page URLs. In theory I need to create new 301 redirects from this existing pages to the new optimised URLS. I am concerned that in a few years I might end up with a string of 301 redirects and if I break some links I might loose some ranking. How many redirects will link juice work for? I hope I'm clear here, if not I've attached a image showing what I'm doing. Thank you. unledfh.jpg
Technical SEO | | Seaward-Group0