Sign in

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

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #1579
    ianbogue

    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
    andriezzoandriezzo

    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
    ianbogue

    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
    BobBob
    Support

    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
    andriezzoandriezzo

    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
    ianbogue

    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.