You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@lucene.apache.org by GitBox <gi...@apache.org> on 2021/03/02 13:22:30 UTC

[GitHub] [lucene-site] janhoy opened a new pull request #47: SOLR-15177: Attempt to link to javadoc and refguide in htaccess

janhoy opened a new pull request #47:
URL: https://github.com/apache/lucene-site/pull/47


   Non-tested rewrite rule magic to link in refguide at https://solr.apache.org/guide/X_Y and javadoc at https://solr.apache.org/docs/X_Y_Z/ on the new Solr site
   
   https://issues.apache.org/jira/browse/SOLR-15177


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


[GitHub] [lucene-site] janhoy commented on a change in pull request #47: SOLR-15177: Attempt to link to javadoc and refguide in htaccess

Posted by GitBox <gi...@apache.org>.
janhoy commented on a change in pull request #47:
URL: https://github.com/apache/lucene-site/pull/47#discussion_r585838432



##########
File path: themes/solr/templates/htaccess.template
##########
@@ -46,33 +46,32 @@ RedirectMatch Permanent ^mirrors-solr-3x-redir downloads.html
 RedirectMatch Permanent ^mirrors-solr-redir.html downloads.html
 
 # Simple redirect to "directory", so later rules match
-RedirectMatch temp ^/(core|solr)/api$ $0/
-RedirectMatch Permanent ^/(core|solr)/\d+_\d+_\d+$ $0/
-RedirectMatch Permanent ^/solr/guide/\d+_\d+$ $0/
+RedirectMatch temp ^/api$ $0/
+RedirectMatch Permanent ^/docs/\d+_\d+_\d+$ $0/
+RedirectMatch Permanent ^/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
 # might change again in the future
-RedirectMatch temp ^/core/api/(.*) /core/{{ SOLR_LATEST_RELEASE | replace(".", "_") }}/$1
-RedirectMatch temp ^/solr/api/org/(.*) /solr/{{ SOLR_LATEST_RELEASE | replace(".", "_") }}/solr-core/org/$1
-RedirectMatch temp ^/solr/api/(.*) /solr/{{ SOLR_LATEST_RELEASE | replace(".", "_") }}/$1
-RedirectMatch temp ^/solr/guide/(?!index.html)([a-z].*) /solr/guide/{{ SOLR_LATEST_RELEASE.rsplit(".", 1) | first | replace(".", "_") }}/$1
+RedirectMatch temp ^/api/org/(.*) /docs/{{ SOLR_LATEST_RELEASE | replace(".", "_") }}/solr-core/org/$1
+RedirectMatch temp ^/api/(.*) /docs/{{ SOLR_LATEST_RELEASE | replace(".", "_") }}/$1
+RedirectMatch temp ^/guide/(?!index.html)([a-z].*) /guide/{{ SOLR_LATEST_RELEASE.rsplit(".", 1) | first | replace(".", "_") }}/$1
 
 # Solr Tutorial is now in the Solr Ref Guide
 # should redirect automatically to latest version
-RedirectMatch Permanent ^/quickstart.html /solr/guide/solr-tutorial.html
+RedirectMatch Permanent ^/quickstart.html /guide/solr-tutorial.html
 
 # redirect older point versions to latest (to keep number of javadocs small):
-RedirectMatch Permanent ^/solr/4_0_0-(ALPHA|BETA)(.*) /solr/4_0_0$2
-RedirectMatch Permanent ^/solr/api-(.*) /solr/$1
+RedirectMatch Permanent ^/docs/4_0_0-(ALPHA|BETA)(.*) /docs/4_0_0$2
+RedirectMatch Permanent ^/docs/api-(.*) /docs/$1
 
 ### Javadocs & Solr Refguide
 
 # Hack: Append slash, if folder name does not end with slash - everything containing a "." is treated as file and excluded from redirect:
-RewriteRule ^(core|solr)/\d+_\d+_\d+/(?!.+\.\w+$|.+/$).+$   $0/ [R=301,L]
-RewriteRule ^solr/guide/\d+_\d+/(?!.+\.\w+$|.+/$).+$        $0/ [R=301,L]
+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:
-RewriteRule ^(core|solr)/\d+_\d+_\d+/.*$  __root/docs.lucene.apache.org/content/$0 [PT]
-RewriteRule ^solr/guide/\d+_\d+/.*$       __root/docs.lucene.apache.org/content/$0 [PT]
+RewriteRule ^docs/(\d+_\d+_\d+/.*)$  __root/docs.lucene.apache.org/content/solr/$1 [PT]

Review comment:
       Yes, looks like it is supported: https://httpd.apache.org/docs/2.4/rewrite/intro.html#InternalBackRefs




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


[GitHub] [lucene-site] janhoy merged pull request #47: SOLR-15177: Attempt to link to javadoc and refguide in htaccess

Posted by GitBox <gi...@apache.org>.
janhoy merged pull request #47:
URL: https://github.com/apache/lucene-site/pull/47


   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


[GitHub] [lucene-site] janhoy commented on a change in pull request #47: SOLR-15177: Attempt to link to javadoc and refguide in htaccess

Posted by GitBox <gi...@apache.org>.
janhoy commented on a change in pull request #47:
URL: https://github.com/apache/lucene-site/pull/47#discussion_r585840767



##########
File path: themes/solr/templates/htaccess.template
##########
@@ -46,33 +46,32 @@ RedirectMatch Permanent ^mirrors-solr-3x-redir downloads.html
 RedirectMatch Permanent ^mirrors-solr-redir.html downloads.html
 
 # Simple redirect to "directory", so later rules match
-RedirectMatch temp ^/(core|solr)/api$ $0/
-RedirectMatch Permanent ^/(core|solr)/\d+_\d+_\d+$ $0/
-RedirectMatch Permanent ^/solr/guide/\d+_\d+$ $0/
+RedirectMatch temp ^/api$ $0/
+RedirectMatch Permanent ^/docs/\d+_\d+_\d+$ $0/
+RedirectMatch Permanent ^/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
 # might change again in the future
-RedirectMatch temp ^/core/api/(.*) /core/{{ SOLR_LATEST_RELEASE | replace(".", "_") }}/$1
-RedirectMatch temp ^/solr/api/org/(.*) /solr/{{ SOLR_LATEST_RELEASE | replace(".", "_") }}/solr-core/org/$1
-RedirectMatch temp ^/solr/api/(.*) /solr/{{ SOLR_LATEST_RELEASE | replace(".", "_") }}/$1
-RedirectMatch temp ^/solr/guide/(?!index.html)([a-z].*) /solr/guide/{{ SOLR_LATEST_RELEASE.rsplit(".", 1) | first | replace(".", "_") }}/$1
+RedirectMatch temp ^/api/org/(.*) /docs/{{ SOLR_LATEST_RELEASE | replace(".", "_") }}/solr-core/org/$1
+RedirectMatch temp ^/api/(.*) /docs/{{ SOLR_LATEST_RELEASE | replace(".", "_") }}/$1
+RedirectMatch temp ^/guide/(?!index.html)([a-z].*) /guide/{{ SOLR_LATEST_RELEASE.rsplit(".", 1) | first | replace(".", "_") }}/$1
 
 # Solr Tutorial is now in the Solr Ref Guide
 # should redirect automatically to latest version
-RedirectMatch Permanent ^/quickstart.html /solr/guide/solr-tutorial.html
+RedirectMatch Permanent ^/quickstart.html /guide/solr-tutorial.html
 
 # redirect older point versions to latest (to keep number of javadocs small):
-RedirectMatch Permanent ^/solr/4_0_0-(ALPHA|BETA)(.*) /solr/4_0_0$2
-RedirectMatch Permanent ^/solr/api-(.*) /solr/$1
+RedirectMatch Permanent ^/docs/4_0_0-(ALPHA|BETA)(.*) /docs/4_0_0$2

Review comment:
       Yes, on the Lucene side of things I think we can do like this, except the /solr/X_Y_Z which must be rewritten to /docs/X_Y_Z. So putting those rules first and fallback to the generic rule shold do the trick.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


[GitHub] [lucene-site] uschindler commented on a change in pull request #47: SOLR-15177: Attempt to link to javadoc and refguide in htaccess

Posted by GitBox <gi...@apache.org>.
uschindler commented on a change in pull request #47:
URL: https://github.com/apache/lucene-site/pull/47#discussion_r585832210



##########
File path: themes/solr/templates/htaccess.template
##########
@@ -46,33 +46,32 @@ RedirectMatch Permanent ^mirrors-solr-3x-redir downloads.html
 RedirectMatch Permanent ^mirrors-solr-redir.html downloads.html
 
 # Simple redirect to "directory", so later rules match
-RedirectMatch temp ^/(core|solr)/api$ $0/
-RedirectMatch Permanent ^/(core|solr)/\d+_\d+_\d+$ $0/
-RedirectMatch Permanent ^/solr/guide/\d+_\d+$ $0/
+RedirectMatch temp ^/api$ $0/
+RedirectMatch Permanent ^/docs/\d+_\d+_\d+$ $0/
+RedirectMatch Permanent ^/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
 # might change again in the future
-RedirectMatch temp ^/core/api/(.*) /core/{{ SOLR_LATEST_RELEASE | replace(".", "_") }}/$1
-RedirectMatch temp ^/solr/api/org/(.*) /solr/{{ SOLR_LATEST_RELEASE | replace(".", "_") }}/solr-core/org/$1
-RedirectMatch temp ^/solr/api/(.*) /solr/{{ SOLR_LATEST_RELEASE | replace(".", "_") }}/$1
-RedirectMatch temp ^/solr/guide/(?!index.html)([a-z].*) /solr/guide/{{ SOLR_LATEST_RELEASE.rsplit(".", 1) | first | replace(".", "_") }}/$1
+RedirectMatch temp ^/api/org/(.*) /docs/{{ SOLR_LATEST_RELEASE | replace(".", "_") }}/solr-core/org/$1
+RedirectMatch temp ^/api/(.*) /docs/{{ SOLR_LATEST_RELEASE | replace(".", "_") }}/$1
+RedirectMatch temp ^/guide/(?!index.html)([a-z].*) /guide/{{ SOLR_LATEST_RELEASE.rsplit(".", 1) | first | replace(".", "_") }}/$1
 
 # Solr Tutorial is now in the Solr Ref Guide
 # should redirect automatically to latest version
-RedirectMatch Permanent ^/quickstart.html /solr/guide/solr-tutorial.html
+RedirectMatch Permanent ^/quickstart.html /guide/solr-tutorial.html
 
 # redirect older point versions to latest (to keep number of javadocs small):
-RedirectMatch Permanent ^/solr/4_0_0-(ALPHA|BETA)(.*) /solr/4_0_0$2
-RedirectMatch Permanent ^/solr/api-(.*) /solr/$1
+RedirectMatch Permanent ^/docs/4_0_0-(ALPHA|BETA)(.*) /docs/4_0_0$2

Review comment:
       I am not sure if we need those, as the solr.apache.org site is new, so the "old" redirects should not be there anyways. It depends on the redirects on Lucene side: If we have a general perm (301) redirect from lucene.apache.org/solr/ -> solr.apache.org/, we should keep them here.

##########
File path: themes/solr/templates/htaccess.template
##########
@@ -46,33 +46,32 @@ RedirectMatch Permanent ^mirrors-solr-3x-redir downloads.html
 RedirectMatch Permanent ^mirrors-solr-redir.html downloads.html
 
 # Simple redirect to "directory", so later rules match
-RedirectMatch temp ^/(core|solr)/api$ $0/
-RedirectMatch Permanent ^/(core|solr)/\d+_\d+_\d+$ $0/
-RedirectMatch Permanent ^/solr/guide/\d+_\d+$ $0/
+RedirectMatch temp ^/api$ $0/
+RedirectMatch Permanent ^/docs/\d+_\d+_\d+$ $0/
+RedirectMatch Permanent ^/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
 # might change again in the future
-RedirectMatch temp ^/core/api/(.*) /core/{{ SOLR_LATEST_RELEASE | replace(".", "_") }}/$1
-RedirectMatch temp ^/solr/api/org/(.*) /solr/{{ SOLR_LATEST_RELEASE | replace(".", "_") }}/solr-core/org/$1
-RedirectMatch temp ^/solr/api/(.*) /solr/{{ SOLR_LATEST_RELEASE | replace(".", "_") }}/$1
-RedirectMatch temp ^/solr/guide/(?!index.html)([a-z].*) /solr/guide/{{ SOLR_LATEST_RELEASE.rsplit(".", 1) | first | replace(".", "_") }}/$1
+RedirectMatch temp ^/api/org/(.*) /docs/{{ SOLR_LATEST_RELEASE | replace(".", "_") }}/solr-core/org/$1
+RedirectMatch temp ^/api/(.*) /docs/{{ SOLR_LATEST_RELEASE | replace(".", "_") }}/$1
+RedirectMatch temp ^/guide/(?!index.html)([a-z].*) /guide/{{ SOLR_LATEST_RELEASE.rsplit(".", 1) | first | replace(".", "_") }}/$1
 
 # Solr Tutorial is now in the Solr Ref Guide
 # should redirect automatically to latest version
-RedirectMatch Permanent ^/quickstart.html /solr/guide/solr-tutorial.html
+RedirectMatch Permanent ^/quickstart.html /guide/solr-tutorial.html
 
 # redirect older point versions to latest (to keep number of javadocs small):
-RedirectMatch Permanent ^/solr/4_0_0-(ALPHA|BETA)(.*) /solr/4_0_0$2
-RedirectMatch Permanent ^/solr/api-(.*) /solr/$1
+RedirectMatch Permanent ^/docs/4_0_0-(ALPHA|BETA)(.*) /docs/4_0_0$2
+RedirectMatch Permanent ^/docs/api-(.*) /docs/$1
 
 ### Javadocs & Solr Refguide
 
 # Hack: Append slash, if folder name does not end with slash - everything containing a "." is treated as file and excluded from redirect:
-RewriteRule ^(core|solr)/\d+_\d+_\d+/(?!.+\.\w+$|.+/$).+$   $0/ [R=301,L]
-RewriteRule ^solr/guide/\d+_\d+/(?!.+\.\w+$|.+/$).+$        $0/ [R=301,L]
+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:
-RewriteRule ^(core|solr)/\d+_\d+_\d+/.*$  __root/docs.lucene.apache.org/content/$0 [PT]
-RewriteRule ^solr/guide/\d+_\d+/.*$       __root/docs.lucene.apache.org/content/$0 [PT]
+RewriteRule ^docs/(\d+_\d+_\d+/.*)$  __root/docs.lucene.apache.org/content/solr/$1 [PT]

Review comment:
       should work using capture group, I think!




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org