Order details and invoice are public and searcheable in Google

Started by acuabit, January 10, 2017, 13:39:47 PM

Previous topic - Next topic

Studio 42

Tyr in .htaccess
#Activate rewriting
RewriteEngine On
#disable access from google
RewriteCond %{HTTP_REFERER} google\.com [NC]
RewriteCond %{QUERY_STRING} ^view=invoice
RewriteRule .* - [F]

You can use similar using the user agent
RewriteCond %{HTTP_USER_AGENT} AltaVista [OR]
RewriteCond %{HTTP_USER_AGENT} Googlebot [OR]
RewriteCond %{HTTP_USER_AGENT} msnbot [OR]
RewriteCond %{HTTP_USER_AGENT} Slurp
RewriteCond %{QUERY_STRING} ^view=invoice
RewriteRule .* - [F]
See for eg. https://www.htmlremix.com/seo/block-google-and-bots-using-htaccess-and-robots-txt
Some more info http://www.inmotionhosting.com/support/website/restricting-bots/how-to-stop-search-engines-from-crawling-your-website
Note : i don't tested the rules

javerleo

Thanks Studio 42.

I will try to use .htaccess directives instead of PHP custom code to redirect the unwanted Google links. On the other hand, I still can't find a way to stop Google indexing the PDF orders. This store uses Cloudflare CDN for caching. Could it be the origin of the problem?

Best regards. 

jenkinhill

Quote from: javerleo on July 26, 2017, 22:15:21 PM
This store uses Cloudflare CDN for caching. Could it be the origin of the problem?

Very much so. A lot of people have had cart problems using Cloudflare which presents url caching issues. There is no reason to use a CDN for a store site. If site speed is the issue then use a faster, more resourced host.
Kelvyn
Lowestoft, Suffolk, UK

Retired from forum life November 2023

Please mention your VirtueMart, Joomla and PHP versions when asking a question in this forum

javerleo


AH

QuoteCreated a redirect rule via PHP code at the beginning of the main index.php (bad idea since it will be removed with updates. Where should I put the code?). Now all the Google links redirect to the site homepage (checking HTTP referral).

Adding an .htaccess rule to redirect links is fine

But your registered customers will no longer be able to view their invoices when they sign in to their account
Regards
A

Joomla 3.10.11
php 8.0

tomphillipspcs

Actually seems to have been fixed now - so it does look like this was a bug in virtuemart/joomla

Tom