Author Topic: Order details and invoice are public and searcheable in Google  (Read 21451 times)

Studio 42

  • Contributing Developer
  • Sr. Member
  • *
  • Posts: 4728
  • Joomla & Virtuemart developper
    • Studio 42 - Virtuemart & Joomla extentions
  • VirtueMart Version: 2.6 & 3
Re: Order details and invoice are public and searcheable in Google
« Reply #45 on: July 26, 2017, 13:53:44 PM »
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

  • Beginner
  • *
  • Posts: 13
Re: Order details and invoice are public and searcheable in Google
« Reply #46 on: July 26, 2017, 22:15:21 PM »
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

  • UK Web Developer & Consultant
  • Global Moderator
  • Super Hero
  • *
  • Posts: 28746
  • Always on vacation
    • Jenkin Hill Internet
Re: Order details and invoice are public and searcheable in Google
« Reply #47 on: July 26, 2017, 23:06:08 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

Jenkin Hill Internet,
Lowestoft, Suffolk, UK

Unsolicited PMs/emails will be ignored.

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

Currently using VirtueMart 4.2.5 10924 J! 3.10.11 PHP 8.2.7

javerleo

  • Beginner
  • *
  • Posts: 13
Re: Order details and invoice are public and searcheable in Google
« Reply #48 on: July 26, 2017, 23:21:27 PM »
Thank you jenkinhill.

I will take your advice.


Regards.

AH

  • Global Moderator
  • Sr. Member
  • *
  • Posts: 3517
  • VirtueMart Version: 4.0.12.10777
Re: Order details and invoice are public and searcheable in Google
« Reply #49 on: July 27, 2017, 10:33:19 AM »
Quote
Created 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

  • Jr. Member
  • **
  • Posts: 51
  • A beginner
Re: Order details and invoice are public and searcheable in Google
« Reply #50 on: July 27, 2017, 13:13:34 PM »
Actually seems to have been fixed now - so it does look like this was a bug in virtuemart/joomla

Tom