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

Redirect loop #166

Open
j-jalving opened this issue Jan 22, 2024 · 1 comment
Open

Redirect loop #166

j-jalving opened this issue Jan 22, 2024 · 1 comment

Comments

@j-jalving
Copy link

When editing the slug of an entry a redirect is automatically created. Is this done by the plugin or by Statamic?

Either way, it seems to be causing some issues. Sometimes I notice after renaming the slug and visiting the page, I get caught in a redirect loop. You can see it in this example where the slug kennis has been renamed to kennisbank:

Screenshot 2024-01-22 at 14 06 01

I think this might be caused by a faulty regex. As you can see it just keeps adding everything after kennis over and over again.

@faltjo
Copy link
Contributor

faltjo commented Apr 3, 2024

I have observed the same behaviour. Redirects which are created automatically on change of an entry use match_type regex and the capture group is appended at the end of the redirect, which can lead to such loops.

Take this example:
/test(.*) redirects to /test-new-url$1, now visit /test-. It will lead to something like /test-new-url-new-url-new-url-new-url-new-url-new-url-new-url... and so on in the address bar and eventually chrome will tell you that the page is broken (ERR_TOO_MANY_REDIRECTS).

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