Skip to content

docusaurus-plugin-client-redirects does not keep the query string. #8206

@F4r3n

Description

@F4r3n

Have you read the Contributing Guidelines on issues?

Prerequisites

  • I'm using the latest version of Docusaurus.
  • I have tried the npm run clear or yarn clear command.
  • I have tried rm -rf node_modules yarn.lock package-lock.json and re-installing packages.
  • I have tried creating a repro with https://new.docusaurus.io.
  • I have read the console error message carefully (if applicable).

Description

I am using docusaurus-plugin-client-redirects
https://github.com/facebook/docusaurus/tree/main/packages/docusaurus-plugin-client-redirects
The plugin creates new pages with this content:

....
  <script>
    window.location.href = '<%= it.toUrl %>'
  </script>

But the new page does not receive the search params.
I would like something like that:

....
  <script>
    window.location.href = '<%= it.toUrl %>' + window.location.search
  </script>

Reproducible demo

No response

Steps to reproduce

  1. Use the plugin docusaurus-plugin-client-redirects
  2. Go to a page with search params
  3. The redirected page does not receive the search params

Expected behavior

The new redirected page receive the search query.

Actual behavior

The new redirected page does not receive the search query

Your environment

  • Docusaurus version used: 2.1.0

Self-service

  • I'd be willing to fix this bug myself.

Metadata

Metadata

Assignees

No one assigned

    Labels

    featureThis is not a bug or issue with Docusausus, per se. It is a feature request for the future.good first issueIf you are just getting started with Docusaurus, this issue should be a good place to begin.hacktoberfeststatus: accepting prThis issue has been accepted, and we are looking for community contributors to implement this

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions