You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
So, the redirects plugin says "From URL" but actually needs a relative path as of now.
A solution could be to prepend the NEXT_PUBLIC_SERVER_URL to the url-prop inside the PayloadRedirects-component since that somewhat encapsulates the redirect logic.
Describe the Bug
When using the redirects plugin:
Example 1: This does not work
Example 2: This works
If you do as in Example 1, you have to prepend the process.env.NEXT_PUBLIC_SERVER_URL in each route (e.g [slug]) to the url. On this line:
https://github.com/payloadcms/payload/blob/main/templates/website/src/app/(frontend)/%5Bslug%5D/page.tsx#L51
Otherwise the PayloadRedirects-component will look for a redirect with the URL matching the relative path.
https://github.com/payloadcms/payload/blob/main/templates/website/src/components/PayloadRedirects/index.tsx#L17
So, the redirects plugin says "From URL" but actually needs a relative path as of now.
A solution could be to prepend the NEXT_PUBLIC_SERVER_URL to the url-prop inside the PayloadRedirects-component since that somewhat encapsulates the redirect logic.
Link to the code that reproduces this issue
https://github.com/payloadcms/payload/blob/main/templates/website/src/components/PayloadRedirects/index.tsx#L17
Reproduction Steps
Which area(s) are affected? (Select all that apply)
plugin: other, area: templates
Environment Info
The text was updated successfully, but these errors were encountered: