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

Negating a previous capture with "not" in rewrites #81

Closed
whaaaley opened this issue Mar 27, 2019 · 1 comment
Closed

Negating a previous capture with "not" in rewrites #81

whaaaley opened this issue Mar 27, 2019 · 1 comment

Comments

@whaaaley
Copy link

whaaaley commented Mar 27, 2019

It could just be that I am misunderstanding how this works. But I've tried every combination I can think of. My goal is to direct all routes without /dp to index, and everything with /dp to it's html file. Is this possible?

      rewrites: [
        { source: '!/dp', destination: '/index.html' },
        { source: '/dp/:id', destination: '/dp/:id.html' }
      ],

Edit: This is NOT related to #77 ... I've rolled back to 5.0.7 and tested on that version as well.

@whaaaley
Copy link
Author

      rewrites: [
        { source: '!/dp/**', destination: '/index.html' },
        { source: '/dp/:id', destination: '/dp/:id.html' }
      ],

The solution was to add /** afterwards. This seems like an odd requirement but it did what I wanted. Maybe it's still a bug? Not sure. I'm going caution on user error. Closing this issue. o/

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

1 participant