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

404 page redirects fitting vanity paths to the long-form url #270

Merged
merged 3 commits into from
Sep 28, 2023

Conversation

DriftingSands
Copy link
Collaborator

@aem-code-sync
Copy link

aem-code-sync bot commented Sep 26, 2023

Hello, I'm Franklin Bot and I will run some test suites that validate the page speed.
In case there are problems, just click the checkbox below to rerun the respective action.

  • Re-run PSI Checks

@aem-code-sync
Copy link

aem-code-sync bot commented Sep 26, 2023

Page Scores Audits Google
/story/phil-mickelson-tweet-pga-tour-liv-merger Lighthouse returned error: ERRORED_DOCUMENT_REQUEST. Lighthouse was unable to reliably load the page you requested. Make sure you are testing the correct URL and that the server is properly responding to all requests. (Status code: 404) PSI

@aem-code-sync
Copy link

aem-code-sync bot commented Sep 26, 2023

Page Scores Audits Google
/story/phil-mickelson-tweet-pga-tour-liv-merger Lighthouse returned error: ERRORED_DOCUMENT_REQUEST. Lighthouse was unable to reliably load the page you requested. Make sure you are testing the correct URL and that the server is properly responding to all requests. (Status code: 404) PSI

404.html Outdated
const pathLocation = sitemap.find((obj) => Object.hasOwn(obj, window.location.pathname))
if (pathLocation) {
const drivePath = '/content-v2/' + pathLocation[window.location.pathname].replace('/content/golfdigest-com/en/', '').replace('.html', '')
window.location.assign(drivePath)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the user clicks on the back button, does he end up in an infinite loop in this case ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no, I have not found that to be the case

404.html Outdated
const imageContainer = document.querySelector(".error-image");
imageContainer.appendChild(pictureElement);
import { createOptimizedPicture } from "/scripts/lib-franklin.js";
import sitemap from "/import/tools/importer/data/sitemap.json" assert {type: 'json'}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That doesn't work on firefox and other browsers see https://caniuse.com/mdn-javascript_statements_import_import_assertions_type_json

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

firefox should now be supported

@aem-code-sync
Copy link

aem-code-sync bot commented Sep 27, 2023

Hello, I'm the AEM Code Sync Bot and I will run some test suites that validate the page speed.
In case there are problems, just click the checkbox below to rerun the respective action.

  • Re-run PSI Checks

@aem-code-sync
Copy link

aem-code-sync bot commented Sep 27, 2023

Page Scores Audits Google
/story/phil-mickelson-tweet-pga-tour-liv-merger Lighthouse returned error: ERRORED_DOCUMENT_REQUEST. Lighthouse was unable to reliably load the page you requested. Make sure you are testing the correct URL and that the server is properly responding to all requests. (Status code: 404) PSI

const canonicalLinkTag = document.head.querySelector('link[rel="canonical"]');
if (canonicalLinkTag) {
const longPathMetadata = document.createElement('meta');
longPathMetadata.setAttribute('property', 'hlx:long-form-path');
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@icaraps icaraps merged commit 1386005 into main Sep 28, 2023
1 of 2 checks passed
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