Sign in

Is there a way to prevent Publii from overwriting the 404.html file?

  • This topic has 5 replies, 3 voices, and was last updated 3 years, 8 months ago by .
Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #1579
    Avatar photo[anonymous]

    I modified the 404 page from my theme to include custom text, CSS classes, and a JavaScript back button. Every time I render a preview of my website, it writes over my 404.html and I have to resave it from my code editor. Is there a way to stop Publii from doing this?

    #1592
    Avatar photo[anonymous]

    A possible solution could be:

    • customize your 404 file (provided by Publii) and rename it like:   404-page.html  or something like this.
    • declare your default error page via htaccess:

    ErrorDocument 404 /404-page.html

    it should work

    #1597
    Avatar photo[anonymous]

    Hi @andriezzo,

    Thanks for that. I have a tendency to ignore certain things, for instance the fact that I was editing the Preview render file. Of course, in Input there isn’t a 404.html file. Does .htaccess go in the root of my Input folder?

    #1598
    Avatar photoBob

    Hi, the 404.html file can be found in the following location: ‎⁨(Documents ▸ ⁨Publii⁩ ▸ ⁨sites⁩ ▸ ⁨YOUR_SITE ▸ ⁨input⁩ ▸ ⁨themes⁩ ▸ ⁨YOUR_THEME)

    --
    Do you appreciate the support you've received today? If so, consider donating to the Publii team by clicking here; we'll be sure to use your donation to make Publii even better!

    #1606
    Avatar photo[anonymous]
    ianbogue wrote:

    Hi @andriezzo,

    Does .htaccess go in the root of my Input folder?

    Yes, it must be in the root folder but it works on an Apache server.

    #1607
    Avatar photo[anonymous]

    Great. Thanks all for your replies. I do appreciate it!

Viewing 6 posts - 1 through 6 (of 6 total)
  • The topic ‘Is there a way to prevent Publii from overwriting the 404.html file?’ is closed to new replies.