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

Support for redirects or querying where old aliases moved #28

Open
Alexnortung opened this issue Apr 3, 2023 · 1 comment
Open

Support for redirects or querying where old aliases moved #28

Alexnortung opened this issue Apr 3, 2023 · 1 comment
Labels
enhancement New feature or request

Comments

@Alexnortung
Copy link
Collaborator

Alexnortung commented Apr 3, 2023

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": {}
}
@boazpoolman
Copy link
Member

Yes! I'm with you on this.
This needs to be added. I might do some work on this plugin over the summer, I'll be sure to take a look at this issue by that time 🙂

@boazpoolman boazpoolman added the enhancement New feature or request label Apr 4, 2023
@Alexnortung Alexnortung mentioned this issue Aug 24, 2023
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants