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

Module fails to return a redirect, for URI's that contain query strings #112

Open
toddpadwick opened this issue Jan 31, 2022 · 2 comments
Open

Comments

@toddpadwick
Copy link

Query string rules do not work - such as:
/news/?filter_category=universities => /loop

It simply returns a 404.

@toddpadwick toddpadwick changed the title Module doesn't work with uris containing query strings Module fails to return a redirect, for URI's that contain query strings Jan 31, 2022
@Thomas-Deasington
Copy link

Hi @toddpadwick, I've found an easy solution for this problem.
The field from is expecting a regex, so the problem is that ? will be interpret as a quantifier.
To fix the problem, you have to escape special characters with \

You should have something like that:
{ from: '/news\?filter_category=universities', to: '/loop' }

@toddpadwick
Copy link
Author

Ah okay thank you @Thomas-Deasington . That works now!

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

No branches or pull requests

2 participants