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

Don't redirect errors to /wp-json/ #126

Merged
merged 1 commit into from
Jul 5, 2020
Merged

Don't redirect errors to /wp-json/ #126

merged 1 commit into from
Jul 5, 2020

Conversation

epicfaace
Copy link
Member

@epicfaace epicfaace commented Jul 5, 2020

Reasons for making this change

Previously, we had redirected all errors on the stanford daily page to https://wp.stanforddaily.com/wp-json/. This is because in order for the REST API to work, we need to redirect all paths from https://stanforddaily.com/wp-json/... to their corresponding https://wp.stanforddaily.com/wp-json/... paths.

However, this caused issues because when there was just an error on the page with rendering an article (which has nothing to do with the REST API), it would also redirect to /wp-json/ and become cached, so users would commonly just see code when going to our site.

This PR changes that approach by:

Testing

http://localhost:3000/wp-json/tsd/json/v1/tag/coronavirus/1 should redirect to https://wp.stanforddaily.com/wp-json/tsd/json/v1/tag/coronavirus/1.

@epicfaace epicfaace requested a review from hs4man21 July 5, 2020 19:28
@epicfaace epicfaace merged commit a87e803 into master Jul 5, 2020
@epicfaace epicfaace deleted the redirect-wp-json branch July 5, 2020 22:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants