Skip to content

[Redirects] Support for redirects or querying where old aliases moved #28

@Alexnortung

Description

@Alexnortung

Feature request

Summary

If I change the url of one of my pages, no information is stored about where the old url. I would like to be able to know if a url has been moved when querying a url alias.

example:
I have a page /my-page I change the url to /my-awesome-page.
Then when i query /api/url-alias/get?path=/my-page I would like to get some information back that the page has been moved to /my-awesome-page.

I would also like an interface where I can set these redirects up.

Why is it needed?

It is important for search engines and the web in general that you can make 301 or 302 redirects, and currently this is not possible with url-alias.

Let's say another page linked to /my-page, they would be met with a 404, but I really would like them to be redirected to /my-awesome-page.

The page that shows the redirects is needed to set up custom redirects, this is needed when switching from some other site to a new and you should populate the initial redirects.

Suggested solution(s)

Whenever the url alias of a content type changes, the user should be asked if they want to save the redirect. If they choose to, then the redirect would be stored in the database still pointing to the same entity.

If a new entity with the old url is created, it should overwrite the old redirect

A request to /api/url-alias/get?path=/my-page could probably return something like this:

{
  "data": {
    "type": "redirect",
    "reditrect_url": "/my-awesome-page",
    "contentType": "api::page.page"
  },
  "meta": {}
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels
    No fields configured for Feature.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions