cagov / ca-design-system-gutenberg-blocks

DEPRECATED: CA Design System Gutenberg blocks for WordPress.
MIT License
4 stars 5 forks source link

Managing redirects in WordPress architecture #56

Closed aaronhans closed 2 years ago

aaronhans commented 3 years ago

We currently have 2 ways we are managing redirects in WordPress:

  1. The cannabis WordPress site uses the plugin from redirection.me. This does a lot of cool things:

    • well documented
    • keeps track of changes to slugs
    • allows manual exports of full dataset
    • allows data retrieval via WP REST API (but requires authentication) Some things aren't optimal
    • To create a redirect users need elevated permissions
    • not sure how we'd integrate this with translated version of site
  2. Redirect url pairs managed in WordPress post table on covid19 Good parts:

    • Any editor can contribute to this list
    • Fully integrated into WP -> headless publishing pipeline already
    • Data available via WordPress API without authentication Issues:
    • Does not watch for slug changes
    • Annoying to enter all translated url patterns for changed urls

We have done some work on cannabis WP -> headless redirects here: https://github.com/cagov/cannabis.ca.gov/issues/350

We have exported the set of redirects, written and tested a script that uses that dataset to create all the redirects in our AWS hosting environment during the build process. Since you need to be an admin to create a redirect this could possibly be enough to remove redirects as a launch blocker for pointing the cannabis site to the headless version.

We do need to merge our redirect managing strategies though and come up with a standard method of managing them in WordPress and moving the data into the headless host. This is not a huge engineering challenge but we want to come up with the best method that works for site managers.

chachasikes commented 2 years ago

@aaronhans Assigning this back to you - any updates?

also - cleaning up issue - is this a duplicate?

aaronhans commented 2 years ago

I assigned this to @wrendo because we decided completing the system link so the redirects automatically publish from WordPress wasn't a headless launch blocker.

This seems like a duplicate of https://github.com/cagov/odi-engineering/issues/32

chachasikes commented 2 years ago

Some useful notes from merging 57 into this thread: https://github.com/cagov/ca-design-system-gutenberg-blocks/issues/57#issuecomment-958092564 https://github.com/cagov/ca-design-system-gutenberg-blocks/issues/57#issuecomment-959413440

chachasikes commented 2 years ago

https://dev-cagov-dcc.pantheonsite.io/wp-json/redirection/v1/export-public/1/json https://dev-cagov-dcc.pantheonsite.io/wp-json/redirection/v1/export-public/1/csv

@aaronhans

This example on cannabis dev site doesn't have a lot of data but it does work for testing in headless.

aaronhans commented 2 years ago

Open PRs: https://github.com/cagov/cannabis.ca.gov/pull/438 https://github.com/cagov/services-wordpress-to-github-cannabis-ca-gov/pull/1

chachasikes commented 2 years ago

Closing: We can reopen, or rescope if needed - no actions are required at this time though. Adding this issue to a list of features we are tracking for publishing hand-over.