Skip to content
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

Error redirects with params #27194

Closed
Jommartinez opened this issue Jul 15, 2021 · 1 comment · Fixed by #27545
Closed

Error redirects with params #27194

Jommartinez opened this issue Jul 15, 2021 · 1 comment · Fixed by #27545
Labels
bug Issue was opened via the bug report template.

Comments

@Jommartinez
Copy link

Jommartinez commented Jul 15, 2021

Describe the Bug

Problem creating 301 redirects

Expected Behavior

when creating a redirect it passes the parameters to the destination by default, but the expected result is a url without parameters.

To Reproduce

Just putting the following code in next.config.js

async redirects() {
    return [
      {
        'source': '/lamps.html\\?p=1',
        'destination': '/lamps',
        'permanent': true
      },
    ]
}

The redirect from /lamps.html?p=1 makes it to /lamps?p=1 and the expected result is /lamps

@Jommartinez Jommartinez added the bug Issue was opened via the bug report template. label Jul 15, 2021
@Jommartinez Jommartinez changed the title Redirects Unexpected MODIFIER Error redirects with params Jul 15, 2021
@kodiakhq kodiakhq bot closed this as completed in #27545 Jul 27, 2021
kodiakhq bot pushed a commit that referenced this issue Jul 27, 2021
This documents the request query passing behavior of redirects to help avoid confusion. 

## Documentation / Examples

- [x] Make sure the linting passes

Closes: #27194
flybayer pushed a commit to blitz-js/next.js that referenced this issue Aug 19, 2021
This documents the request query passing behavior of redirects to help avoid confusion. 

## Documentation / Examples

- [x] Make sure the linting passes

Closes: vercel#27194
@balazsorban44
Copy link
Member

This issue has been automatically locked due to no recent activity. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.

@vercel vercel locked as resolved and limited conversation to collaborators Jan 28, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue was opened via the bug report template.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants