Skip to content

Re-direct to 404 page not working when deployed to Posit Connect #12940

Open
@lcd2yyz

Description

@lcd2yyz

I have:

  • searched the issue tracker for similar issues
  • installed the latest version of Quarto CLI
  • formatted my issue following the Bug Reports guide

Bug description

I'm developing a Quarto-website. When webpage rendered in local sessions (eg. Posit Workbench session or desktop Rstudio), clicking on broken links correctly re-direct to a custom 404 page. However when deployed on to Posit Connect as website (regardless as static or source code), the custom 404 page does not appear, it's just go to a blank page with tiny text 404 page not found.

I tried adding the Posit Connect Content URL link into site-url and site-path, didn't work either.

Steps to reproduce

All scripts below are in the project base directory.

_quarto.yml

project:
  type: website

website:
  title: "quarto_testing"
  navbar:
    left:
      - href: index.qmd
        text: Home
      - about.qmd

format:
  html:
    toc: true

index.qmd

---
title: "quarto_testing"
---

This is a Quarto website.

- Link to working page: [About Page](about.qmd)
- Link to broken page: [Broken page](broken.qmd)

404.qmd

---
title: "My 404 test"
---

404 Testing page

![Wiki](https://upload.wikimedia.org/wikipedia/en/8/80/Wikipedia-logo-v2.svg)

about.qmd

---
title: "About"
---

About this site

```{r}
1 + 1
```

Actual behavior

When clicking on the "broken page", custom 404 page does not appear, it's just go to a blank page with tiny text 404 page not found.
But if I type 404.html into the URL address bar, the page do appear.

Expected behavior

When clicking on the "broken page", re-directs to 404.html page

Your environment

  • IDE: RStudio Pro 2024.04.0 Build 735.pro3
  • OS: Mac Sonoma 14.7.5

Quarto check output

Quarto 1.4.553
[✓] Checking versions of quarto binary dependencies...
Pandoc version 3.1.11: OK
Dart Sass version 1.69.5: OK
Deno version 1.37.2: OK
[✓] Checking versions of quarto dependencies......OK
[✓] Checking Quarto installation......OK
Version: 1.4.553
Path: /usr/lib/rstudio-server/bin/quarto/bin

[✓] Checking tools....................OK
TinyTeX: (external install)
Chromium: (not installed)

[✓] Checking LaTeX....................OK
Using: Installation From Path
Path: /usr/local/bin
Version: 2024

[✓] Checking basic markdown render....OK

[✓] Checking Python 3 installation....OK
Version: 3.9.14
Path: /opt/python/3.9.14/bin/python3
Jupyter: 5.7.2
Kernels: python3

[✓] Checking Jupyter engine render....OK

[✓] Checking R installation...........OK
Version: 4.4.0
Path: /usr/lib/R
LibPaths:
- /mnt/home/[username lib path]/4.4
- /usr/local/lib/R/site-library
- /usr/lib/R/site-library
- /usr/lib/R/library
knitr: 1.50
rmarkdown: 2.29

[✓] Checking Knitr engine render......OK

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions