How do I create and use a custom 404 page in my pinegrow project and local pinegrow 'server'?

From YouTube I believe I need to create a .htaccess file to tell the ‘server’ to use my custom 404 html page, but when I tried to use pinegrow 9 to add that file, it didn’t create anything.

Aside from 404, what are the other core error pages I need to create and how do I add those to Pinegrow project so they show up in the local pg ‘server’ too?

I’ve used VSC to create a .htaccess file with the contents:

ErrorDocument 404 /404.html

and I’ve saved that ‘.htaccess’ file into the root of my project’s folder.

But still, when my website goes to a wrong page on the local pg server, I get the standard pg 404 error page.

What am I doing wrong? I’ve check the Settings page in PG and there’s nothing there I can see about this.

You need Apache (or Litespeed) for the .htaccess errorDocument to work. It will work on your webhost if that’s what you’re using. Depends on your host setup determines how you handle 404s

I’m not using anything other than Pinegrow at the moment.

Sorry, I thought that was clear in my question; I want to know how to use my custom 404 in pinegrow so that when I preview my ‘site’ using pinegrow’s preview button (local server) that it uses my 404 and not pinegrows.

Please re-read my answer.

You can see your 404.html page in local preview by just going to that page.

You can’t see your 404 page in local preview by going to a wrong / dead link - it only shows the pinegrow one.

I’m asking how (if possible) to change that so it shows mine, or isn’t that possible at all?!

HI @TEMPEST
Im not sure if pinegrow adheres to the whole .htaccess thing.

I think it just runs a basic internal webserver which polls the PG app, in order to display the projects working pages in real time so you can see changes in the browser as you make them in PG.

I did check out the creation of the page though and even though you can create the .htaccess flle in PG,

AND add to the file types editable in the PG settings, it still doesnt show up as file in the PG project view.
as per

I’m not sure if that is because any file starting with a “.” is by default a hidden file on Mac OS, I dont know.

That is a topic for the devs to answer.
Ok, cheerio

As I said, htaccess errorDocument requires an Apache or compatible ie litespeed environment for that to work. If you want that working locally you need to set it up, something like localWP, MAMP etc.

If you want to preview your 404 page, just visit the page url, ie /404.html.

2 Likes