Apache Solr open-source search software
SOLR-16262: Fix htaccess rules for ref-guide robots tag (#915)
Houston Putman192523347179
diff --git a/dev-tools/scripts/refguide/gen-refguide-redirects.py b/dev-tools/scripts/refguide/gen-refguide-redirects.pyindex 155e1aec793..e7ab1cb1ce0 100755--- a/dev-tools/scripts/refguide/gen-refguide-redirects.py+++ b/dev-tools/scripts/refguide/gen-refguide-redirects.py@@ -113,10 +113,11 @@ def main():failed[frm] = "404"if conf.htaccess:- print("# Existing pages moved to sub path")+ print("# Existing pages moved to sub path in the 9.0 guide")for key in regex_new:print("RedirectMatch 301 ^/guide/(%s)\.html /guide/solr/latest/%s/$1.html" % ("|".join(regex_new[key]), key))- print("# Page renames in 9.0")+ print("# Page renames between 8.x and 9.0")+ print("RewriteRule ^guide/9_0/solr-tutorial.html /guide/solr/latest/getting-started/solr-tutorial.html [R=301,NE,L]")for key in result:if result[key].startswith("https://"):print("RewriteRule ^guide/%s %s [R=301,NE,L]" % (key, result[key]))@@ -132,10 +133,8 @@ def main():print("""# 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)_.*#">- <If "%%{REQUEST_URI} !~ m#^/guide/8_11/%s$#">- Header set X-Robots-Tag "noindex,nofollow,noarchive"- </If>+<If "%%{REQUEST_URI} =~ m#/guide/(6|7|8)_.*# && %%{REQUEST_URI} !~ m#/guide/8_11/%s$#">+ Header set X-Robots-Tag "noindex,nofollow,noarchive"</If>""" % old_version_pages_regex)else:out("Regex mappings:")