pressbooks / ideas

Ideas for Pressbooks.
GNU General Public License v3.0
12 stars 4 forks source link

[Feature] Allow admins to create permanent redirects from one book to another URL #352

Closed SteelWagstaff closed 3 years ago

SteelWagstaff commented 3 years ago

Use case: A person initially publishes a book on pressbooks.com (or some other network). Later, the 'canonical' version of book has been moved to a new location (a PressbooksEDU network or its own website). They would like to set up a permanent redirect pointing the old URL (i.e. https://steelsbook.pressbooks.com) to the new URL (i.e. https://university.pressbooks.pub/steelsbook). We should allow super admins to create redirects for books published on their network. Should we let network managers and/or book admins do this as well?

Ideas: Could use https://developer.wordpress.org/reference/functions/wp_redirect/.

If we wanted to do this directly from the server, redirect rules could be added to https://github.com/pressbooks/pressbooks-infrastructure/blob/master/trellis/nginx-includes/wordpress-site.conf.child, or we could consider creating a mapping block in https://github.com/pressbooks/pressbooks-infrastructure/blob/master/trellis/group_vars/production/wordpress_sites.yml that creates the nginx config.

Client requests: https://pressbooks.zendesk.com/agent/tickets/2417 (from SLCC) + https://pressbooks.zendesk.com/agent/tickets/3580 (Oregon State) + https://pressbooks.zendesk.com/agent/tickets/3880 (from VT)

SteelWagstaff commented 3 years ago

Issue should be resolved at next deploy through the addition of Redirection and pressbooks-plugin-config plugin to our bedrocks. The ability to create/manager redirects will only be available for super admins on Pressbooks-hosted networks. Open source users who are interested in this ability may want to consider the use of https://redirection.me/