uschindler commented on code in PR #77: URL: https://github.com/apache/solr-site/pull/77#discussion_r866675510
########## themes/solr/templates/htaccess.template: ########## @@ -82,7 +82,13 @@ RedirectMatch ^/operator/downloads/crds/(v\d+\.\d+\.\d+)(/?.*)$ https://www.apac RewriteRule ^(docs|guide)/\d+(?!.+\.\w+$|.+/$).+$ $0/ [R=301,L] # __root/docs.solr.apache.org/ is a special alias added by INFRA-19439, so we can refer to stuff in other places like SVN -RewriteRule ^(docs|guide)/\d+.*$ __root/docs.solr.apache.org/$0 [PT] +RewriteRule ^docs/\d+.*$ __root/docs.solr.apache.org/$0 [PT] +# 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 Review Comment: 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). -- 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. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
