You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by us...@apache.org on 2020/02/26 09:39:58 UTC
[lucene-site] branch master updated: Second try to get the strage
__rot URL disappear by adding directory-redirects
This is an automated email from the ASF dual-hosted git repository.
uschindler pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/lucene-site.git
The following commit(s) were added to refs/heads/master by this push:
new f4634e1 Second try to get the strage __rot URL disappear by adding directory-redirects
f4634e1 is described below
commit f4634e1b50fac45cf7d8f36af9087ac0dff17696
Author: Uwe Schindler <us...@apache.org>
AuthorDate: Wed Feb 26 10:39:37 2020 +0100
Second try to get the strage __rot URL disappear by adding directory-redirects
---
themes/lucene/templates/htaccess.template | 13 +++++++++----
1 file changed, 9 insertions(+), 4 deletions(-)
diff --git a/themes/lucene/templates/htaccess.template b/themes/lucene/templates/htaccess.template
index aa5e077..3d9c871 100644
--- a/themes/lucene/templates/htaccess.template
+++ b/themes/lucene/templates/htaccess.template
@@ -15,6 +15,7 @@
RewriteEngine on
RewriteBase /
+RewriteOptions Inherit
<If "%{HTTPS} == 'on'">
Header always set Strict-Transport-Security "max-age=300"
@@ -55,8 +56,9 @@ RewriteRule ^solr/version_control.html solr/resources.html#solr-version-control
RewriteRule ^solr/mailing_lists.html solr/resources.html#community [R=301,NE]
# Simple redirect to "directory", so later rules match
-RedirectMatch temp ^/core/api$ /core/api/
-RedirectMatch temp ^/solr/api$ /solr/api/
+RedirectMatch temp ^/(core|solr)/api$ $0/
+RedirectMatch temp ^/(core|solr)/\d+_\d+_\d+$ $0/
+RedirectMatch temp ^/solr/guide/\d+_\d+$ $0/
# Other pages can always be redirected to the "most current" released javadocs
# using "temp" instead of permanent so crawlers know that they
@@ -127,7 +129,10 @@ RedirectMatch Permanent ^/lucy/(.*)$ https://lucy.apache.org/
### Javadocs & Solr Refguide
+# This fixes redirects generated by directory-without-slash to not have the __root from next rule in it:
+RewriteRule ^__root/docs.lucene.apache.org/content/(.*)$ /$1 [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:
-RewriteRule ^(core|solr)/(\d+_\d+_\d+\b.*)$ __root/docs.lucene.apache.org/content/$1/$2 [PT]
-RewriteRule ^solr/guide/(\d+_\d+\b.*)$ __root/docs.lucene.apache.org/content/solr/guide/$1 [PT]
+RewriteRule ^(core|solr)/(\d+_\d+_\d+/.*)$ __root/docs.lucene.apache.org/content/$1/$2 [PT]
+RewriteRule ^solr/guide/(\d+_\d+/.*)$ __root/docs.lucene.apache.org/content/solr/guide/$1 [PT]