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://moz.com/blog/how-to-advanced-relcanonical-http-headers
-
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.
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
-
Sitemap and canonical
In my sitemap I have two entries for my page ContactUs.asp ContactUs.asp?Lng=E ContactUs.asp?Lng=F What should I use in my page ContactUS.asp ? Is this correct?
Technical SEO | | CustomPuck0 -
Canonical
i have some static webpages in root and wordpress installed in subdirectory , Canonical tag for the whole website was with trailing slash , i stripped the HTML extensions for static webpages but i can't force to add trailing slash to the static webpages so i changed the canonical for html webpages from http://ghadaalsaman.com/articles.html/ to http://ghadaalsaman.com/articles but the Wordpress" http://ghadaalsaman.com/blog/ " still with trailing slash , when i've checked my google webmasters i found that my indexed pages dropped down 100 page ! what should i put in the canonical for the static pages? i tried to strip the slash from wordpress but i failed , so my static webpages canonical with no trailing slash and wordpress with trailing slash .
Technical SEO | | NeatIT0 -
Robots and Canonicals on Moz
We noticed that Moz does not use a robots "index" or "follow" tags on the entire site, is this best practice? Also, for pagination we noticed that the rel = next/prev is not on the actual "button" rather in the header Is this best practice? Does it make a difference if it's added to the header rather than the actual next/previous buttons within the body?
Technical SEO | | PMPLawMarketing0 -
Redirect /label/ to /tags/
Hi guys, I have noticed loads of errors in webmaster, page not found.. /label/..... what i need to do is to a 301 redirect to /tags/... can some one tell me the redirect code to help fix this issue Regards T
Technical SEO | | Taiger0 -
Pagination V Canonical
Hi Guys, I am needing some help with regards to duplicate page content issues. Using Zen Cart on an ecommerce platform and it is bringing up duplicate page content on pages. For instance:- http://www.blissfulkidsparties.com.au/store/1st-birthday-themes-barnyard-bash-1st-birthday-c-67_321/ is the same as:- http://www.blissfulkidsparties.com.au/store/1st-birthday-themes-barnyard-bash-1st-birthday-c-67_321/?sort=20a&page=1 Rel=Prev/Next as I understand it will treat http://www.blissfulkidsparties.com.au/store/1st-birthday-themes-barnyard-bash-1st-birthday-c-67_321/?sort=20a&page=1 http://www.blissfulkidsparties.com.au/store/1st-birthday-themes-barnyard-bash-1st-birthday-c-67_321/?sort=20a&page=2 http://www.blissfulkidsparties.com.au/store/1st-birthday-themes-barnyard-bash-1st-birthday-c-67_321/?sort=20a&page=3 as one page but won't solve the issue of the duplicate content issues between:- http://www.blissfulkidsparties.com.au/store/1st-birthday-themes-barnyard-bash-1st-birthday-c-67_321/ and http://www.blissfulkidsparties.com.au/store/1st-birthday-themes-barnyard-bash-1st-birthday-c-67_321/?sort=20a&page=1 am I better using rel=Canonical here instead??? Kind Regards Neil
Technical SEO | | jazzah0 -
Canonical URL Issue
Hi Everyone, I'm fairly new here and I've been browsing around for a good answer for an issue that is driving me nuts here. I tried to put the canonical url for my website and on the first 5 or 6 pages I added the following script SEOMoz reported that there was a problem with it. I spoke to another friend and he said that it looks like it's right and there is nothing wrong but still I get the same error. For the URL http://www.cacaniqueis.com.br/video-caca-niqueis.html I used the following: <link rel="<a class="attribute-value">canonical</a>" href="http://www.cacaniqueis.com.br/video-caca-niqueis.html" /> Is there anything wrong with it? Many thanks in advance for the attention to my question.. 🙂 Alex
Technical SEO | | influxmedia0 -
Canonical Issues with Wordpress
Hi all, I have just started using Wordpress SEO by Yoast and still having a hard time correcting my Canonical issues for all posts with a .html at the end. The pluggin allows you to add a '/' to the end for canonical issues, but just for pages, not posts. How best in Wordpress to make my post change from .html/ to .html. I really don't want to go to the hassle to make each URL a new 301 redirect in my .htaccess. I hate the .html, but if they are going to stay, how can I make sure I get the .html/ link juice back to them. Many thanks!
Technical SEO | | RunningInTheRain0 -
Http:// vs http://www.
Why is it that when I run an "On Page Optimization Keyword Report" for my website I get a different score when using http://www.tandmkitchens.com vs http://tandmkitchens.com. My keyword is "Kitchen Remodeling" http://www.tandmkitchens.com scores an A http://tandmkitchens.com scores a B It's the same page yet one url scores higher than the other. Any help! Thanks
Technical SEO | | fun52dig
Gary0