Moz Q&A is closed.
After more than 13 years, and tens of thousands of questions, Moz Q&A closed on 12th December 2024. Whilst we’re not completely removing the content - many posts will still be possible to view - we have locked both new posts and new replies. More details here.
Rel Canonical, Follow/No Follow in htaccess?
- 
					
					
					
					
 Very quick question, are rel canonical, follow/no follow tags, etc. written in the htaccess file? 
- 
					
					
					
					
 Hello, Thank you for this information, but I have a followup question. The links you sent me refer to images and PDF's, but this isn't relative to my situation. I need to write in follow/no follow and rel=canonical via htaccess because I do not know how to do it for each individual page on my ecommerce store - additionally, htaccess is easy for me to edit if ever I need to undo something and it is nice to have everything in one place. Can you give me a formatted example of how a follow/no follow and rel=canonical can be placed into a page via the htaccess file please? I intend on doing this for every product category, product and also my home page on my ecommerce store. Thank you 
- 
					
					
					
					
 Robots directives and rel=canonical can be assigned by .htaccess. This is a very handy way to assign noindex or rel=canonical to .pdf documents, print formats, video transcripts, etc. You can also use it to apply noindex or rel=canonical at scale. Two Moz articles (of several) that describe these are.... https://a-moz.groupbuyseo.org/blog/how-to-advanced-relcanonical-http-headers https://a-moz.groupbuyseo.org/blog/htaccess-file-snippets-for-seos 
- 
					
					
					
					
 Hi there, They'll be written in the source code of each applicable page. Alternatively you can dynamically add these tags via google tag manager or within your CMS platform. regards, Sean 
- 
					
					
					
					
 Hi I dont think you can use rel-canonical tags in httaccess however you can define the rule for follow / no follow tag through htacess. 
Browse Questions
Explore more categories
- 
		
		Moz ToolsChat with the community about the Moz tools. 
- 
		
		SEO TacticsDiscuss the SEO process with fellow marketers 
- 
		
		CommunityDiscuss industry events, jobs, and news! 
- 
		
		Digital MarketingChat about tactics outside of SEO 
- 
		
		Research & TrendsDive into research and trends in the search industry. 
- 
		
		SupportConnect on product support and feature requests. 
Related Questions
- 
		
		
		
		
		
		Product Variations (rel=canonical or 301) & Duplicate Product Descriptions
 Hi All, Hoping for a bit of advice here please, I’ve been tasked with building an e-commerce store and all is going well so far. We decided to use Wordpress with Woocommerce as our shop plugin. I’ve been testing the CSV import option for uploading all our products and I’m a little concerned on two fronts: - Product Variations Duplicate content within the product descriptions **Product Variations: - ** We are selling furniture that has multiple variations (see list below) and as a result it creates c.50 product variations all with their own URL’s. Facing = Left, Right Leg style = Round, Straight, Queen Ann Leg colour = Black, White, Brown, Wood Matching cushion = Yes, No So my question is should I 301 re-direct the variation URL’s to the main product URL as from a user perspective they aren't used (we don't have images for each variation that would trigger the URL change, simply drop down options for the user to select the variation options) or should I add the rel canonical tag to each variation pointing back to the main product URL. **Duplicate Content: - ** We will be selling similar products e.g. A chair which comes in different fabrics and finishes, but is basically the same product. Most, if not all of the ‘long’ product descriptions are identical with only the ‘short’ product descriptions being unique. The ‘long’ product descriptions contain all the manufacturing information, leg option/colour information, graphics, dimensions, weight etc etc. I’m concerned that by having 300+ products all with identical ‘long’ descriptions its going to be seen negatively by google and effect the sites SEO. My question is will this be viewed as duplicate content? If so, are there any best practices I should be following for handling this, other than writing completely unique descriptions for each product, which would be extremely difficult given its basically the same products re-hashed. Many thanks in advance for any advice. Technical SEO | | Jon-S0
- 
		
		
		
		
		
		how to set rel canonical on wordpress.com sites
 I know how to do this with a wordpress.org site but I have a client that does not want to switch and without a plugin I am lost. any help would be greatly appreciated. Jeremy Wood Technical SEO | | SOtBOrlando0
- 
		
		
		
		
		
		Do I use /es/, /mx/ or /es-mx/ for my Spanish site for Mexico only
 I currently have the Spanish version of my site under myurl.com/es/ When I was at Pubcon in Vegas last year a panel reviewed my site and said the Spanish version should be in /mx/ rather than /es/ since es is for Spain only and my site is for Mexico only. Today while trying to find information on the web I found /es-mx/ as a possibility. I am changing my site and was planning to change to /mx/ but want confirmation on the correct way to do this. Does anyone have a link to Google documentation that will tell me for sure what to use here? The documentation I read led me to the /es/ but I cannot find that now. Technical SEO | | RoxBrock0
- 
		
		
		
		
		
		Robots.txt to disallow /index.php/ path
 Hi SEOmoz, I have a problem with my Joomla site (yeah - me too!). I get a large amount of /index.php/ urls despite using a program to handle these issues. The URLs cause indexation errors with google (404). Now, I fixed this issue once before, but the problem persist. So I thought, instead of wasting more time, couldnt I just disallow all paths containing /index.php/ ?. I don't use that extension, but would it cause me any problems from an SEO perspective? How do I disallow all index.php's? Is it a simple: Disallow: /index.php/ Technical SEO | | Mikkehl0
- 
		
		
		
		
		
		Hreflang on non-canonical pages
 Hi! I've been trying to figure out what is the best way to solve this dilemma with duplicate content and multiple languages across domains. 1 product info page 2 same product but GREEN Technical SEO | | LarsEriksson
 3 same product but RED
 4 same product but YELLOW **Question: ** Since pages 2,3,4 just varies slightly I use the canonical tag to indicate they are duplicates of page 1. Now I also want to indicate there are other language versions with the_ rel="alternate" hreflang="x" _element. Should I place the _rel="alternate" hreflang="x" _on the canonical page only pointing to the canonical page with "x" language. Should I place the _rel="alternate" hreflang="x" _on all pages pointing to the canonical page with the "x" language? Should I place the _rel="alternate" hreflang="x" _on all pages and then point it to the translated page (even if it is not a canonical page) ? /Lars0
- 
		
		
		
		
		
		Video Sitemaps <video:content_loc>and<video:player_loc></video:player_loc></video:content_loc>
 Hi guys, If I'm creating a video sitemap do I need to use both: video:content_locandvideo:player_loc</video:player_loc></video:content_loc> Or could I just use video:content_loc?</video:content_loc> Thanks Technical SEO | | Tug-Agency0
- 
		
		
		
		
		
		Robots.txt and canonical tag
 In the SEOmoz post - http://www.seomoz.org/blog/robot-access-indexation-restriction-techniques-avoiding-conflicts, it's being said - If you have a robots.txt disallow in place for a page, the canonical tag will never be seen. Does it so happen that if a page is disallowed by robots.txt, spiders DO NOT read the html code ? Technical SEO | | seoug_20050
- 
		
		
		
		
		
		How to set up a rel canonical in big commmerce?
 I have no clue how to set this up in the Bigcommerce store platform Technical SEO | | Firestarter-SEO0
 
			
		 
			
		 
			
		 
			
		 
					
				 
					
				 
					
				 
					
				 
					
				 
					
				 
					
				