Skip to content

fix(RewriteRule): do not redirect for archive or English docs #1408

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

Merged
merged 1 commit into from
Mar 18, 2025

Conversation

erisu
Copy link
Member

@erisu erisu commented Mar 13, 2025

Motivation and Context

Fix redirect for archived docs

Description

Updated the RewriteRules to follow these steps, in order:

  1. Stop rewrite when URL starts with /archive/.
  2. Stop rewrite when URL starts with /docs/en/.
  3. Forward non-English docs to English docs.

Additional Notes:

  • Step three has always been designed to redirect old language documentation to the English version.
    • However, it is possible to change this behavior to redirect them to the archived language documentation instead, if preferred. (Would be in a separate PR)
    • However, since this redirection behavior has been in place for several years, changing it now may no longer be necessary.
  • If old versions of the English documentation are to be archived, the RewriteRule should be placed above step two. In this case, it would redirect to archive.

Testing

Ran a httpd server to test the RewriteRules.

Checklist

  • I've run the tests to see all new and existing tests pass
  • I added automated test coverage as appropriate for this change
  • Commit is prefixed with (platform) if this change only applies to one platform (e.g. (android))
  • If this Pull Request resolves an issue, I linked to the issue in the text above (and used the correct keyword to close issues using keywords)
  • I've updated the documentation if necessary

Copy link
Contributor

@breautek breautek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@erisu erisu force-pushed the fix/rewrite-rules branch from e5348ef to fa540a9 Compare March 18, 2025 02:20
@erisu erisu merged commit d79a681 into apache:master Mar 18, 2025
1 check passed
@erisu erisu deleted the fix/rewrite-rules branch March 18, 2025 03:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants