-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Redirect rules to wire up the 9.0 guide #77
Conversation
… redirect from /guides/9_0
…ide/solr/xxxx is an exception
# Ref-guides up to 8.x | ||
RewriteRule ^guide/(6|7|8)_\d+.*$ __root/docs.solr.apache.org/$0 [PT] | ||
# Redirect v9 and higher guides on format /guide/9_0/foo to /guide/solr/9_0/foo | ||
RedirectMatch Permanent ^/guide/((9|1\d)_\d.*$) /guide/solr/$1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should be a bit careful here as the order of instructions in this file does not guarantee they are executed in that order (I think all rewrites are executed before all redirects). But it looks correct. Maybe we should test this a bit on the staging server.
I would only use RewriteRules and don't mix them here with RedirectMatch. You can use RewriteRules to redirect by adding "[R]" as option at end. If you only have Rewrite rules they are executed in order and you can mark a "matching one" as "last" with "[L]". This allows to do not apply any further rules after the first matched.
For redirects the rule would end in "[R,L]" (redirect and last).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, removing the redirectmatch, and dealying that particular redirect for now.
Going to merge to staging to test the rules (although the guide will not be visible in staging)
Trying this out on staging, this: https://solr.staged.apache.org/guide/solr gets re-routed to: https://solr.staged.apache.org/guide/8_11/solr/ which is not what we want. https://solr.staged.apache.org/guide/solr/ works fine, so we just need to make an explicit exception for the |
Yep, but I think we can simplify this once 9.0 is released, since we don't need this anymore
as we'd likely instead use the more explicit I see Antora has a config for whether you want a redirect from |
yeah we probably want to leave |
The purpose of this is to
/guide/solr/X_Y
to the __root area/guide/9_0
gets redirected (not rewritten) to /guide/solr/9_0/guide/[a-z].*
which would earlier rewrite/guide/solr/xxx
to/guide/8_11/solr/xxx
, make exception forsolr
. After 9.0 release this rule will likely instead be/guide/solr/foo
pointing to/guide/solr/latest/foo
??htaccess.ref-guide-antora
to test the/guide/solr/latest
->/guide/solr/9_0
redirectThis can be committed now, before the release, as there will still be nowhere on our page linking to it. This way we can test the entire new guide on the real site before announcing it.