Skip to main content

Redirects without trailing slash how to

Comments

1 comment

  • Paul Gilzow

    I think you might be running into this piece concerning trailing slashes.

    If I’m understanding your goals correctly, you’ll probably need to add partial redirects on the route entry for https://{default}/:
    You can then use regular expressions to be more accurate on what you do/don’t want redirected.

    https://{default}/foo-detail/:
      type: upstream
      upstream: foo-detail:http
    
    https://{default}/:
        # ...
        redirects:
            expires: 1d
            paths:
                '^/foo(?!-detail)':
                    to: 'https://{default}/foo-detail/A/B/C/some-page.html'
                    regexp: true
    

    This is at least one possible way to do it. I would need to see the rest of your routes.yaml to be able to suggest the optimal method.

    0

Please sign in to leave a comment.