Skip to content

Possible bug: redirect missing site URL in multisite setup #235

@bobmulder

Description

@bobmulder

Hi! Thanks for the great package.

In a multisite Statamic setup, redirects in vendor/rias/statamic-redirect/src/Http/Middleware/HandleNotFound.php seem to lose the site prefix.

Example:

Requested: /nl/old-page
Expected : /nl/new-page
Actual: /new-page

This happens because $redirect->destination() returns only a path, so the site URL isn’t prepended.

✅ My fix

I changed:

$destination = $redirect->destination();

to:

$destination = $site->url() . $redirect->destination();

and did the same in cacheNewRedirect().

Now redirects resolve correctly per site.

💬 Questions

  1. Is this intended behavior or a bug?
  2. Does this seem like the right fix?
  3. Would you be open to a PR?

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions