You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@solr.apache.org by ho...@apache.org on 2023/09/21 18:39:47 UTC

[solr-site] branch main updated: Fix Robots header for old ref guide pages

This is an automated email from the ASF dual-hosted git repository.

houston pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/solr-site.git


The following commit(s) were added to refs/heads/main by this push:
     new a99704e8c Fix Robots header for old ref guide pages
a99704e8c is described below

commit a99704e8c6814175ad72180762aff1191ac337ef
Author: Houston Putman <ho...@apache.org>
AuthorDate: Thu Sep 21 14:39:39 2023 -0400

    Fix Robots header for old ref guide pages
---
 themes/solr/templates/htaccess.ref-guide-old | 8 --------
 themes/solr/templates/htaccess.template      | 7 ++++++-
 2 files changed, 6 insertions(+), 9 deletions(-)

diff --git a/themes/solr/templates/htaccess.ref-guide-old b/themes/solr/templates/htaccess.ref-guide-old
index 42cbf88fa..3c7d72d39 100644
--- a/themes/solr/templates/htaccess.ref-guide-old
+++ b/themes/solr/templates/htaccess.ref-guide-old
@@ -1,11 +1,3 @@
-# Do not index old reference guide pages on search engines, except for pages that don't exist in 9+
-<If "%{REQUEST_URI} =~ m#/?guide/(6|7|8)_.*#">
-  Header always set X-Robots-Tag "noindex,nofollow,noarchive"
-</If>
-<If "%{REQUEST_URI} =~ m#/?guide/8_11/(adding-custom-plugins-in-solrcloud-mode|blob-store-api|blockjoin-faceting|cdcr-api|cdcr-architecture|cdcr-config|cdcr-operations|colocating-collections|cross-data-center-replication-cdcr|dataimport-screen|errata|metrics-history|migrate-to-policy-rule|putting-the-pieces-together|rule-based-replica-placement|solrcloud-autoscaling-api|solrcloud-autoscaling-auto-add-replicas|solrcloud-autoscaling-fault-tolerance|solrcloud-autoscaling-listeners|solrcloud [...]
-  Header always unset X-Robots-Tag
-</If>
-
 # Existing pages moved to sub path in the 9.0 guide
 RedirectMatch 301 ^/guide/(about-this-guide|relevance|solr-glossary|solr-tutorial)\.html /guide/solr/latest/getting-started/$1.html
 RedirectMatch 301 ^/guide/(aliases|audit-logging|authentication-and-authorization-plugins|basic-authentication-plugin|circuit-breakers|client-apis|cloud-screens|cluster-node-management|collection-management|collections-core-admin|configuring-logging|enabling-ssl|hadoop-authentication-plugin|indexupgrader-tool|installing-solr|jvm-settings|jwt-authentication-plugin|kerberos-authentication-plugin|mbean-request-handler|metrics-reporting|performance-statistics-reference|ping|plugins-stats-scr [...]
diff --git a/themes/solr/templates/htaccess.template b/themes/solr/templates/htaccess.template
index 340cc8fc3..ed4991d67 100644
--- a/themes/solr/templates/htaccess.template
+++ b/themes/solr/templates/htaccess.template
@@ -88,7 +88,12 @@ RewriteRule ^(docs|guide)/\d+(?!.+\.\w+$|.+/$).+$          $0/ [R=301,L]
 # __root/docs.solr.apache.org/ is a special alias added by INFRA-19439, so we can refer to stuff in other places like SVN
 RewriteRule ^docs/\d+.*$  __root/docs.solr.apache.org/$0 [PT]
 # Ref-guides up to 8.x
-RewriteRule ^guide/(6|7|8)_\d+.*$  __root/docs.solr.apache.org/$0 [PT]
+# Do not index old reference guide pages on search engines, except for pages in 8_11 that don't exist in 9+
+RewriteRule ^guide/8_11/(adding-custom-plugins-in-solrcloud-mode|blob-store-api|blockjoin-faceting|cdcr-api|cdcr-architecture|cdcr-config|cdcr-operations|colocating-collections|cross-data-center-replication-cdcr|dataimport-screen|errata|metrics-history|migrate-to-policy-rule|putting-the-pieces-together|rule-based-replica-placement|solrcloud-autoscaling-api|solrcloud-autoscaling-auto-add-replicas|solrcloud-autoscaling-fault-tolerance|solrcloud-autoscaling-listeners|solrcloud-autoscaling-o [...]
+RewriteRule ^guide/(6|7|8)_\d+.*$  __root/docs.solr.apache.org/$0 [PT,E=oldref:1]
+Header always set X-Robots-Tag "noindex,nofollow,noarchive" env=oldref
+Header always unset X-Robots-Tag env=oldreflastversion
+
 # Ref-guides from 9.0
 RewriteRule ^guide/(9_\d+)/?$          guide/solr/$1/ [R=301,L]
 RewriteRule ^guide/(_/.+|search-index.js)$  __root/docs.solr.apache.org/$0 [PT]