<@U0D4QPHT4> how do you handle redirects for delet...
# general
f
@tvdeyen how do you handle redirects for deleted pages in alchemy? Did you implement some kind of rack middleware?
t
f
Do you think that’s a feasible approach for solidus as well?
t
Yes
f
Ok, we will take a shot at this as current behavior is not great for SEO https://github.com/solidusio/solidus/issues/6093
👍🏻 1
t
Thanks. I consider this a good feature as well 👍🏻
f
Do you also have strong feelings about this one? https://github.com/solidusio/solidus/issues/6092
Hey, we will start looking into redirects today. How do you envision cancelling redirects? Say product has been deleted, where do we redirect (currently the page stays up). What happens if a slug is removed from a product due to a change and a new product is made using the same slug, do we need a separate process to free it up and throw an error upon safe or do we simply wipe out the old redirect
Old slug > 301 new slug Deleted product > 404 Do we want an interface to manage other redirects (eg manual overrides)? I think it’s low hanging fruit kill this issue once and forever and provide also an interface and api to set any manual 301
Some additional thoughts would be to throw it into a polymorphic table to render the high level functionality also accessible to other ressources such as pages and blog articles.
Would that work for you?
t
1. If a new product is made with the same slug as an old product it should win over the old product. It has most likely been replaced by it and shops can explain this in ie. the product description. Everything else is too complex and should be handled by cusotm business logic (product life cycles, etc.) 2. An interface would be nice but is optional (same for API) 3. Polymorphic is fine, as we already need it for products and taxons
f
ok, I would go for a polymorphic table to allow also the addition of other resources later on. If we already have a table, a visualisation to delete lines should not be a problem. I will think about API and if it’s needed.
If we have a polymorphic table it would make sense to also add generic 301 as we already have everything else pratically rendering the entire solidus_redirector mood. What do you think?
In addition, it would make sense at that point to demote the different treatment of products (slug) and taxons (permalink that is dropped)
In addition it’s worth noting that the permalinks in taxons are not real permalinks but in reality slugs
I am really struggling with the purpose of friendlyid here, could you elaborate why we need it on products, as taxons seems to work well without and it might be easier to just build up a redirection table that contains all lapsed slugs till they are claimed again. The pathway from a request would be to check in the route first if a ressource is available on that route matching the slug such t for taxons and afterwards cycle a table with redirects and last but not least if nowhere found throw a 404
The current implementation of friendlyid creates more problems that it solves from an SEO point of view
we have fixed the redirect situation on products, the correct thing would be to handle 301 on taxons the same way and write an interface to delete links or either drop old history urls if they match the slug the slug of a new resource.