You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by ja...@apache.org on 2021/03/02 21:27:57 UTC

[lucene-site] branch main/solr updated: Fix redirects from /X_Y_Z to /docs/X_Y_Z now that Lucene site only does prefix redirect

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

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


The following commit(s) were added to refs/heads/main/solr by this push:
     new 35fedb1  Fix redirects from /X_Y_Z to /docs/X_Y_Z now that Lucene site only does prefix redirect
35fedb1 is described below

commit 35fedb17f244b44e6197defc2e92c4fe2e9c9b4b
Author: Jan Høydahl <ja...@cominvent.com>
AuthorDate: Tue Mar 2 22:27:43 2021 +0100

    Fix redirects from /X_Y_Z to /docs/X_Y_Z now that Lucene site only does prefix redirect
---
 themes/solr/templates/htaccess.template | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/themes/solr/templates/htaccess.template b/themes/solr/templates/htaccess.template
index afa5ad5..ba16e41 100644
--- a/themes/solr/templates/htaccess.template
+++ b/themes/solr/templates/htaccess.template
@@ -45,6 +45,10 @@ RedirectMatch Permanent ^mirrors-solr-latest-redir.html downloads.html
 RedirectMatch Permanent ^mirrors-solr-3x-redir downloads.html
 RedirectMatch Permanent ^mirrors-solr-redir.html downloads.html
 
+# Top-level javadoc redirect in case redirected from Lucene site /solr/X_Y_Z -> solr.apache.org/x_Y_Z
+RedirectMatch Permanent ^/(\d+_\d+_\d+)$ /docs/$1/
+RedirectMatch Permanent ^/(\d+_\d+_\d+/.*)$ /docs/$1
+
 # Simple redirect to "directory", so later rules match
 RedirectMatch temp ^/api$ $0/
 RedirectMatch Permanent ^/docs/\d+_\d+_\d+$ $0/
@@ -65,13 +69,14 @@ RedirectMatch Permanent ^/quickstart.html /guide/solr-tutorial.html
 RedirectMatch Permanent ^/docs/4_0_0-(ALPHA|BETA)(.*) /docs/4_0_0$2
 RedirectMatch Permanent ^/docs/api-(.*) /docs/$1
 
-### Javadocs & Solr Refguide
+### Javadocs & Refguide
 
 # Hack: Append slash, if folder name does not end with slash - everything containing a "." is treated as file and excluded from redirect:
 RewriteRule ^docs/\d+_\d+_\d+/(?!.+\.\w+$|.+/$).+$          $0/ [R=301,L]
 RewriteRule ^guide/\d+_\d+/(?!.+\.\w+$|.+/$).+$             $0/ [R=301,L]
 
-# __root/docs.lucene.apache.org/content/ is a special alias added by INFRA-19439, so we can refer to stuff in other places like SVN:
+# __root/docs.lucene.apache.org/content/ is a special alias added by INFRA-19439, so we can refer to stuff in other places like SVN
+# TODO: Move solr specific content to own root location and change these rules
 RewriteRule ^docs/(\d+_\d+_\d+/.*)$  __root/docs.lucene.apache.org/content/solr/$1 [PT]
 RewriteRule ^guide/\d+_\d+/.*$       __root/docs.lucene.apache.org/content/solr/$0 [PT]