documentation-developer icon indicating copy to clipboard operation
documentation-developer copied to clipboard

Fix 404 image on dev and staging

Open adriendupuis opened this issue 2 years ago • 0 comments

Question Answer
JIRA Ticket
Versions
Edition

Production status

404 page's image works on production thanks to a redirection

GET https://doc.ibexa.co/images/404.png
302 Found
Location: https://doc.ibexa.co/en/master/images/404.png

PR preview status

On a PR preview, the redirection doesn't exist:

GET https://ez-systems-developer-documentation--2415.com.readthedocs.build/images/404.png
404 Not Found

CSS and JS are not loaded because several URLs use a wrong path with latest instead of the PR number.

Local status

Locally, the redirection doesn't exist:

GET https://localhost:8008/images/404.png
404 Not Found

Fixes

  • Production and local:
    • Full absolute URL to the 404.png.
  • PR previews:
    • Full (but wrong) absolute URL to 404.png
    • JavaScript replacing /en/latest/ by /en/<PR#> in every URLs, and reloading the JS files.

For example, compare current PR 404 to another PR 404

Checklist

  • [ ] Text renders correctly
  • [ ] Text has been checked with vale
  • [ ] Description metadata is up to date
  • [ ] Redirects cover removed/moved pages
  • [ ] Code samples are working
  • [ ] PHP code samples have been fixed with PHP CS fixer
  • [ ] Added link to this PR in relevant JIRA ticket or code PR

adriendupuis avatar Oct 24 '23 07:10 adriendupuis