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

Adding Conditions to Handle 404 redirect_code for Invalid Urls and Ad… #4357

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 31 additions & 1 deletion packages/venia-ui/upward.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,12 @@ veniaResponse:
- matches: urlResolver.redirect_code
pattern: '(301|302)'
use: dynamicRedirect
- matches: request.url.pathname
pattern: '^/(account-information|address-book|cart|checkout|communications|sign-in|contact-us|create-account|forgot-password|order-confirmation|order-history|customer/account/createPassword|saved-payments|search\.html|wishlist)$'
use: veniaAppShell
- matches: urlResolver.redirect_code
pattern: '(404)'
use: notFoundResponse
default: veniaAppShell

# A FileResolver for serving certain files directly from document root,
Expand Down Expand Up @@ -255,4 +261,28 @@ dynamicRedirect:
resolver: file
file:
resolver: inline
inline: './index.html'
inline: './index.html'

notFoundResponse:
resolver: inline
inline:
status: urlResolver.redirect_code
headers:
resolver: inline
inline:
content-type:
inline: text/html
cache-control:
inline: s-maxage=60
body:
resolver: template
engine: mustache
provide:
pageType: veniaPageType.data
pageTypeNonce: veniaPageTypeNonce.nonce
webpackChunks: veniaWebpackChunks.scripts
template:
resolver: file
file:
resolver: inline
inline: './index.html'
Loading