Incorrect request object in 404 handler
Nobody has claimed this yet.
- Dominant language
- Ruby
- Stars
- 11.9k
- Forks
- 1.5k
- Avg merge
- 17h 55m
- Merged PRs (30d)
- 3
Description
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.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing how the 404 template receives its request object and how request.path and request.url are exposed to Liquid. Reproduce a not-found page and compare the browser URL with the request values available in the template. Done means the original URL is available for a 301 redirect, with coverage for 404 rendering.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- ruby
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100