-
Notifications
You must be signed in to change notification settings - Fork 1
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
Conversation
… existing path that was not re-routed
Hello, I'm Franklin Bot and I will run some test suites that validate the page speed.
|
|
|
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) |
There was a problem hiding this comment.
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 ?
There was a problem hiding this comment.
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'} |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
Hello, I'm the AEM Code Sync Bot and I will run some test suites that validate the page speed.
|
|
const canonicalLinkTag = document.head.querySelector('link[rel="canonical"]'); | ||
if (canonicalLinkTag) { | ||
const longPathMetadata = document.createElement('meta'); | ||
longPathMetadata.setAttribute('property', 'hlx:long-form-path'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
404 page now checks if the current path could be a vanity path for an existing path that was not re-routed
Test URLs: