Shopify / liquid

Liquid markup language. Safe, customer facing template language for flexible web apps.

Home Page:https://shopify.github.io/liquid/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Incorrect request object in 404 handler

galbaras opened this issue · comments

When using the 404 template, the request object does not contain the URL shown in the browser's address bar. Instead, it refers to /404.

Therefore, it's impossible to use request.path, request.url, etc to identify the "not found" page. In fact, that URL doesn't appear anywhwere in any section of the page, including the HEAD tag.

Please provide this information, so that it can be used in Liquid. Specifically, I would like to create a HTTP 301 redirect based on this information, so would love to know how this can be done, and if it's not possible, have it enabled.

Hi @galbaras

If you are looking to setup redirection rule, you can use "URL redirects" feature [where you can add redirection rule]

Note: All the broken links are managed using "URL redirects" option.
Visit: "Online Stores" > "Navigation" > "View URL redirects"

URL-redirects

Since URL redirects don't allow wildcards/regular expressions, it's impossible to cover everything I need and keep it up to date. So either regular expressions should be supported or the 404 template should allow programmatic redirection by providing the necessary information to Liquid.