Hello,
I have a weird issue. I have a Cart menu link, which I set to noindex nofollow, but that meta tag is not inserted into the actual cart page. Anyone has an idea how to do this?
Hi,
you can do it in your .htaccess like so :
(just replace the word "cart" with your own cart link)
## NOINDEX NOFOLLOW
RewriteCond %{REQUEST_URI} (.*)/cart$ [NC]
RewriteRule ^.*$ - [ENV=NOINDNOFO:true]
Header set X-Robots-Tag "noindex, nofollow" env=NOINDNOFO
Quote from: sirius on May 07, 2021, 10:06:55 AM
Hi,
you can do it in your .htaccess like so :
(just replace the word "cart" with your own cart link)
## NOINDEX NOFOLLOW
RewriteCond %{REQUEST_URI} (.*)/cart$ [NC]
RewriteRule ^.*$ - [ENV=NOINDNOFO:true]
Header set X-Robots-Tag "noindex, nofollow" env=NOINDNOFO
This doesn't work.
You can add the rule in the robots.txt
Disallow: /cart/
I do not tested it, but most engine should use it
Quote from: Studio 42 on August 04, 2021, 20:25:49 PM
You can add the rule in the robots.txt
Disallow: /cart/
I do not tested it, but most engine should use it
This is an option, but it's not great, because Google still indexes it. So the preferred optuon is the meta tag.
<?php
//SEO
$document = JFactory::getDocument();
$document->setMetaData('robots', "noindex, nofollow");
//SEO END
?>
Quote from: pinochico on August 17, 2021, 11:21:08 AM
<?php
//SEO
$document = JFactory::getDocument();
$document->setMetaData('robots', "noindex, nofollow");
//SEO END
?>
Thanks! This works.
Quote from: Huubs on August 14, 2021, 13:54:57 PM
This is an option, but it's not great, because Google still indexes it. So the preferred optuon is the meta tag.
Google follow the robots.txt but if a page is already indexed, it get not removed directly if you do not remove it in the google console
This is same for meta tag noindex
Quote from: pinochico on August 17, 2021, 11:21:08 AM
<?php
//SEO
$document = JFactory::getDocument();
$document->setMetaData('robots', "noindex, nofollow");
//SEO END
?>
I think that should be part in the core, or not?
Imho we solved that earlier by robots.txt. Provided in the fullinstaller, imho.