Custom 404 pages.. making them work...

All WYSIWYG Web Builder support issues that are not covered in the forums below.
Forum rules
IMPORTANT NOTE!!

DO YOU HAVE A QUESTION OR PROBLEM AND WANT QUICK HELP?
THEN PLEASE SHARE A "DEMO" PROJECT.



PLEASE READ THE FORUM RULES BEFORE YOU POST:
http://www.wysiwygwebbuilder.com/forum/viewtopic.php?f=12&t=1901

MUST READ:
http://www.wysiwygwebbuilder.com/getting_started.html
WYSIWYG Web Builder FAQ
Post Reply
User avatar
kreemerz
 
 
Posts: 90
Joined: Wed Apr 06, 2022 2:58 pm
Contact:

Custom 404 pages.. making them work...

Post by kreemerz »

Just a quick question on how to get my custom 404 page to show up in my site.

Is there some trick? I recall having a host years ago where all I had to do was design the page and rename it "404.html" and it would work like it was supposed to (show up when I tried to access a nonexistent page.

Apparently, that's not the case anymore.

Any ideas?
Last edited by kreemerz on Sat Apr 23, 2022 8:35 pm, edited 1 time in total.
WWBman
 
 
Posts: 917
Joined: Fri Jan 08, 2010 6:10 pm

Re: Custom 404 pages.. making them work...

Post by WWBman »

You can name your error page whatever you like.
It must not have any external css style sheets so the Tools > Option > HTML > CSS must be unticked.
There should be an entry in the .htaccess file on the server as follows:
ErrorDocument 404 /errorpages/error404.php
where /errorpages/error404.php is where your error page is and can be anything you like.
wwonderfull
 
 
Posts: 1439
Joined: Fri Aug 21, 2020 8:27 am
Contact:

Re: Custom 404 pages.. making them work...

Post by wwonderfull »

kreemerz wrote: Sat Apr 23, 2022 8:17 pm Just a quick question on how to get my custom 404 page to show up in my site.

Is there some trick? I recall having a host years ago where all I had to do was design the page and rename it "404.html" and it would work like it was supposed to (show up when I tried to access a nonexistent page.

Apparently, that's not the case anymore.

Any ideas?
In your case I think it should be more like
ErrorDocument 404 /404.html
If you have a single 404 error page along with your normal pages
User avatar
kreemerz
 
 
Posts: 90
Joined: Wed Apr 06, 2022 2:58 pm
Contact:

Re: Custom 404 pages.. making them work...

Post by kreemerz »

wwonderfull wrote: Sat Apr 23, 2022 9:15 pm
kreemerz wrote: Sat Apr 23, 2022 8:17 pm Just a quick question on how to get my custom 404 page to show up in my site.

Is there some trick? I recall having a host years ago where all I had to do was design the page and rename it "404.html" and it would work like it was supposed to (show up when I tried to access a nonexistent page.

Apparently, that's not the case anymore.

Any ideas?
In your case I think it should be more like
ErrorDocument 404 /404.html
If you have a single 404 error page along with your normal pages
Hmm... still not showing up... should I edit the htaccess file within Cpanel?
or create my own htaccess file?
WWBman
 
 
Posts: 917
Joined: Fri Jan 08, 2010 6:10 pm

Re: Custom 404 pages.. making them work...

Post by WWBman »

You should edit the .htaccess file.
User avatar
kreemerz
 
 
Posts: 90
Joined: Wed Apr 06, 2022 2:58 pm
Contact:

Re: Custom 404 pages.. making them work...

Post by kreemerz »

WWBman wrote: Sat Apr 23, 2022 10:31 pm You should edit the .htaccess file.
And just add the line "ErrorDocument 404 /mywebsite.com/error/404.php" line?
WWBman
 
 
Posts: 917
Joined: Fri Jan 08, 2010 6:10 pm

Re: Custom 404 pages.. making them work...

Post by WWBman »

If your error page is 404.html in the root then it should be as wwonderfull stated.
You don’t need to include your website, just the error page.
User avatar
KingSparta
 
 
Posts: 269
Joined: Tue Dec 08, 2020 6:00 pm
Location: Earth
Contact:

Re: Custom 404 pages.. making them work...

Post by KingSparta »

On Godaddy, the extender is not HTML,it is ".shtml"

My 404 page

https://myaagrapevines.com/404.shtml
Retired military with Airborne, Air Assault, and Flight Wings. Enjoys model trains, the internet, and ham radio. Located in Fayetteville, NC, USA. Avatar created by AI.
https://MyAAGrapevines.com
https://CenterCityBBS.Com (Grupo Chat, & Forum)
User avatar
BaconFries
 
 
Posts: 5641
Joined: Thu Aug 16, 2007 7:32 pm

Re: Custom 404 pages.. making them work...

Post by BaconFries »

On Godaddy, the extender is not HTML,it is ".shtml"
@KingSparta Now not judging you in anyway what so ever...but can you please show in any documentation that you cannot use .html, .php for the 404 but only .shtml when using GoDaddy.
User avatar
kreemerz
 
 
Posts: 90
Joined: Wed Apr 06, 2022 2:58 pm
Contact:

Re: Custom 404 pages.. making them work...

Post by kreemerz »

https://privatebin.support-tools.com/?a ... VEBMGA4ro=

Image

I wish this forum had a way to display images...

My page works but the text and everything is all jumbled up... doesn't look anything like the orginal.
User avatar
KingSparta
 
 
Posts: 269
Joined: Tue Dec 08, 2020 6:00 pm
Location: Earth
Contact:

Re: Custom 404 pages.. making them work...

Post by KingSparta »

BaconFries wrote: Sun Apr 24, 2022 1:47 am
On Godaddy, the extender is not HTML,it is ".shtml"
@KingSparta Now not judging you in anyway what so ever...but can you please show in any documentation that you cannot use .html, .php for the 404 but only .shtml when using GoDaddy.
I was not saying that, only that GoDaddy's default is shtml

I should have been more clear.
Retired military with Airborne, Air Assault, and Flight Wings. Enjoys model trains, the internet, and ham radio. Located in Fayetteville, NC, USA. Avatar created by AI.
https://MyAAGrapevines.com
https://CenterCityBBS.Com (Grupo Chat, & Forum)
User avatar
BaconFries
 
 
Posts: 5641
Joined: Thu Aug 16, 2007 7:32 pm

Re: Custom 404 pages.. making them work...

Post by BaconFries »

My page works but the text and everything is all jumbled up... doesn't look anything like the orginal.
From looking at the image it shows that not all files are uploaded this may be the css files or even the jquery or any javascript used.
You cannot upload images directly to the forum for security reasons. But you can still display them by wrapping them with

Code: Select all

[img][/img]
I would suggest you keep them in the simplest way such as

Code: Select all

[img]https://www.yoursiteurl.com/yourimg.jpg[/img]
Uploading to your own site or any of the free image hosting sites.
User avatar
kreemerz
 
 
Posts: 90
Joined: Wed Apr 06, 2022 2:58 pm
Contact:

Re: Custom 404 pages.. making them work...

Post by kreemerz »

So it does need to be a PHP file?
User avatar
BaconFries
 
 
Posts: 5641
Joined: Thu Aug 16, 2007 7:32 pm

Re: Custom 404 pages.. making them work...

Post by BaconFries »

Confused now....what is it your asking is it why your page looks jumbled (answered) or should the 404 page extension be .php or .html? if you use .php then you will need to include a header or a http response code

Code: Select all

<?php http_response_code(404); include('your404.php'); // provide your own HTML for the error page die();?>
If using just .html then see previous answers on the use of using a .htcaccess file for this

I have also made it so that your image is displayed in your thread using the following site imgbb.com using the Embedded code-> BBcode full link with the url generated.
User avatar
kreemerz
 
 
Posts: 90
Joined: Wed Apr 06, 2022 2:58 pm
Contact:

Re: Custom 404 pages.. making them work...

Post by kreemerz »

I may have confused myself.

All I wanted to do was build a custom 404 page. I already designed it and uploaded it. http://www.kreemerz.com/error/404.html

Now, my host has a Cpanel that unfortunately is the standard for mamaging your site. I'm confused on whether I need to go into the 'Error Pages' section and edit that file or go to the File Manager and edit that file.

I believe someone earlier said that I needed to change my custom 404 page as a PHP file. But sounds like that's not even necessary or just an option.

I was trying the find the most easiest way to do this.
wwonderfull
 
 
Posts: 1439
Joined: Fri Aug 21, 2020 8:27 am
Contact:

Re: Custom 404 pages.. making them work...

Post by wwonderfull »

All I wanted to do was build a custom 404 page. I already designed it and uploaded it. http://www.kreemerz.com/error/404.html
404 pages not so much needed if you have a small website 1-5 page website where you change pages yearly and not monthly or daily. Websites where people upload pages and delete frequently need it the most. You can put a simple, beautiful and artistic way of displaying 404 error page. I personally used 404 error page with simple html page and a beautiful illustration.

For the php error page as @bacon has given the code, you might have to do that I can assure on that. But if you as you stated want everything simple then you can do an html 404 error page depending on your needs you should implement. So it would be your decision 1st hand.
User avatar
kreemerz
 
 
Posts: 90
Joined: Wed Apr 06, 2022 2:58 pm
Contact:

Re: Custom 404 pages.. making them work...

Post by kreemerz »

wwonderfull wrote: Sun Apr 24, 2022 5:13 am
All I wanted to do was build a custom 404 page. I already designed it and uploaded it. http://www.kreemerz.com/error/404.html
404 pages not so much needed if you have a small website 1-5 page website where you change pages yearly and not monthly or daily. Websites where people upload pages and delete frequently need it the most. You can put a simple, beautiful and artistic way of displaying 404 error page. I personally used 404 error page with simple html page and a beautiful illustration.

For the php error page as @bacon has given the code, you might have to do that I can assure on that. But if you as you stated want everything simple then you can do an html 404 error page depending on your needs you should implement. So it would be your decision 1st hand.
I guess the issue I'm having is how to make it work.. how do I get it to show up when you access a nonexistent page.

With the code <?php http_response_code(404); include('/error/404.php'); // provide your own HTML for the error page die();?> , do I place this in the same file (error/404.php)? or does it go in the .htaccess file?

Do I need this line of code as well, "ErrorDocument 404 /mywebsite.com/error/404.php" line?
wwonderfull
 
 
Posts: 1439
Joined: Fri Aug 21, 2020 8:27 am
Contact:

Re: Custom 404 pages.. making them work...

Post by wwonderfull »

I guess the issue I'm having is how to make it work.. how do I get it to show up when you access a nonexistent page.

With the code <?php http_response_code(404); include('/error/404.php'); // provide your own HTML for the error page die();?> , do I place this in the same file (error/404.php)? or does it go in the .htaccess file?

Do I need this line of code as well, "ErrorDocument 404 /mywebsite.com/error/404.php" line?
For the php code I can say our dear moderator @bacon can assist you with his grateful advice on that.
Do I need this line of code as well, "ErrorDocument 404 /mywebsite.com/error/404.php" line?
404 error page whether it is php or html both needs the .htaccess code. and yes it needs to be put inside your websites directory's .htaccess.

Code: Select all

RewriteEngine on
ErrorDocument 404 http://www.yoursite.com/404.php
or in some cases

Code: Select all

RewriteEngine on
ErrorDocument 404 /errors/404.php
User avatar
kreemerz
 
 
Posts: 90
Joined: Wed Apr 06, 2022 2:58 pm
Contact:

Re: Custom 404 pages.. making them work...

Post by kreemerz »

Hmmm... so in Cpanel, I need to add that code to add to the Error 404 page here right?

https://privatebin.support-tools.com/?7 ... GqXMDQdYI=
WWBman
 
 
Posts: 917
Joined: Fri Jan 08, 2010 6:10 pm

Re: Custom 404 pages.. making them work...

Post by WWBman »

Your error page is http://www.kreemerz.com/error/404.html
So the entry in the .htaccess file should be:
ErrorDocument 404 /error/404.html

Just one thing:
See my first reply regarding CSS style sheets.
If this rule still applies then this may be why things are jumbled up.

EDIT:
I've just tested it and the rule still applies.
I.E. The page must not have any external css style sheets so the option Tools > Option > HTML > CSS must be unticked
User avatar
kreemerz
 
 
Posts: 90
Joined: Wed Apr 06, 2022 2:58 pm
Contact:

Re: Custom 404 pages.. making them work...

Post by kreemerz »

WWBman wrote: Sun Apr 24, 2022 8:08 am Your error page is http://www.kreemerz.com/error/404.html
So the entry in the .htaccess file should be:
ErrorDocument 404 /error/404.html

Just one thing:
See my first reply regarding CSS style sheets.
If this rule still applies then this may be why things are jumbled up.

EDIT:
I've just tested it and the rule still applies.
I.E. The page must not have any external css style sheets so the option Tools > Option > HTML > CSS must be unticked
But isn't CSS needed for the rest of the site? I'm sure it's already uploaded to the servers. Would I need to delete the CSS folders?
WWBman
 
 
Posts: 917
Joined: Fri Jan 08, 2010 6:10 pm

Re: Custom 404 pages.. making them work...

Post by WWBman »

You can still use CSS just the same but untick the option Tools > Options > HTML > CSS > Generate external CSS style sheets for page specific styles.
I create a separate project just for the error page in its own folder..
That way only the error page project has the option unticked and all other projects can have the option ticked.
That's how I do it anyway.
User avatar
kreemerz
 
 
Posts: 90
Joined: Wed Apr 06, 2022 2:58 pm
Contact:

Re: Custom 404 pages.. making them work...

Post by kreemerz »

WWBman wrote: Sun Apr 24, 2022 2:50 pm You can still use CSS just the same but untick the option Tools > Options > HTML > CSS > Generate external CSS style sheets for page specific styles.
I create a separate project just for the error page in its own folder..
That way only the error page project has the option unticked and all other projects can have the option ticked.
That's how I do it anyway.
1. So I created a seperate project in WebBuilder and built the 404 page, made the page a PHP one in the builder, unticked the CSS sections.. Uploaded it.
2. Went into cPanel, went to Error pages and pasted ErrorDocument 404 /error/404.php into the page as seen below:
https://privatebin.support-tools.com/?1 ... B0jfE1qU=
3. Tested by going to klnexus.com/notapage and my custom page still wont show. I get the default 404. Not sure why this is such a pain. Seemed like it was so easier of a process before.

🤷‍♂️
WWBman
 
 
Posts: 917
Joined: Fri Jan 08, 2010 6:10 pm

Re: Custom 404 pages.. making them work...

Post by WWBman »

You don't put the ErrorDocument 404 /error/404.php there it needs to be in the .htaccess file.
So if you are creating and publishing your error page project in the /error folder then that's exactly how my setup is.
wwonderfull
 
 
Posts: 1439
Joined: Fri Aug 21, 2020 8:27 am
Contact:

Re: Custom 404 pages.. making them work...

Post by wwonderfull »

Use the html 404 error page instead would do less hassel for you I think. It's much easier to implement which is very basic.
User avatar
kreemerz
 
 
Posts: 90
Joined: Wed Apr 06, 2022 2:58 pm
Contact:

Re: Custom 404 pages.. making them work...

Post by kreemerz »

wwonderfull wrote: Sun Apr 24, 2022 6:09 pm Use the html 404 error page instead would do less hassel for you I think. It's much easier to implement which is very basic.
Still paste the same html code into the .htaccess file?
User avatar
kreemerz
 
 
Posts: 90
Joined: Wed Apr 06, 2022 2:58 pm
Contact:

Re: Custom 404 pages.. making them work...

Post by kreemerz »

WWBman wrote: Sun Apr 24, 2022 5:13 pm You don't put the ErrorDocument 404 /error/404.php there it needs to be in the .htaccess file.
So if you are creating and publishing your error page project in the /error folder then that's exactly how my setup is.
Okay. I might have done that. But I'll give it a try again.
User avatar
kreemerz
 
 
Posts: 90
Joined: Wed Apr 06, 2022 2:58 pm
Contact:

Re: Custom 404 pages.. making them work...

Post by kreemerz »

I finally got it to work.

Thank you all for your patience with me... I really appreciate it. I'm still learning some of this stuff..

@baconfries
@wwonderfull
@WWBman

Looks like the issue was that I was using the errorpage section of cPanel (using Bluehost's KB) and not going directly to the htaccess file...
User avatar
kreemerz
 
 
Posts: 90
Joined: Wed Apr 06, 2022 2:58 pm
Contact:

Re: Custom 404 pages.. making them work...

Post by kreemerz »

WWBman wrote: Sun Apr 24, 2022 2:50 pm You can still use CSS just the same but untick the option Tools > Options > HTML > CSS > Generate external CSS style sheets for page specific styles.
I create a separate project just for the error page in its own folder..
That way only the error page project has the option unticked and all other projects can have the option ticked.
That's how I do it anyway.
While this method does work for me, I do get broken links (where images are missing) on those error pages. Not sure what's causing that. Maybe my occasional upload of updates... kinda a drag to have to keep opening up a new project and uploading the error pages from there.

@wwonderfull had suggested the 'html error page' way of doing this.. I'm now wondering if that may be less of a hassle.
wwonderfull
 
 
Posts: 1439
Joined: Fri Aug 21, 2020 8:27 am
Contact:

Re: Custom 404 pages.. making them work...

Post by wwonderfull »

While this method does work for me, I do get broken links (where images are missing) on those error pages. Not sure what's causing that. Maybe my occasional upload of updates... kinda a drag to have to keep opening up a new project and uploading the error pages from there.
@wwonderfull had suggested the 'html error page' way of doing this.. I'm now wondering if that may be less of a hassle.
404 error page is very simple to know.
In reality I my self as a user rarely got 5 views of 404 error page in a hole year of website browsing. Because the website is removed or has technical problems or the page has been removed from websites host server and showing on google's search engine result for some days before termination. 404 error page was just for a simple indication for people to know that the server cannot find the requested resource. Some people use searches and all that depending on what kind of content they have if they have hundreds and thousands of page they can use searches on 404 error page to lead to another page. But as I said it was an indication for people to know that the server cannot find the requested resource.

So just to show that "page not found" line people made simplest of way to show it from html to php. its just a basic text in the corner saying page not found. But now in modern days people added visuals backgrounds animations and more advanced use of it. It really depends on you what you want people to do when people find your broken page. If you want you can redirect a 404 error page user back to home page or the new page you have created.

HTML or PHP the main purpose is to show people that the "server cannot find the requested resource". So that being known, now I think you can decide what you would like to do with an 404 error page. You can use it creatively or you can use it natively meaning classic.
Last edited by wwonderfull on Tue May 24, 2022 7:52 am, edited 2 times in total.
User avatar
zinc
 
 
Posts: 2154
Joined: Sat Dec 08, 2007 3:06 pm
Location: London, United Kingdom
Contact:

Re: Custom 404 pages.. making them work...

Post by zinc »

wwonderfull wrote: Sun Apr 24, 2022 6:44 am
I guess the issue I'm having is how to make it work.. how do I get it to show up when you access a nonexistent page.

With the code <?php http_response_code(404); include('/error/404.php'); // provide your own HTML for the error page die();?> , do I place this in the same file (error/404.php)? or does it go in the .htaccess file?

Do I need this line of code as well, "ErrorDocument 404 /mywebsite.com/error/404.php" line?
For the php code I can say our dear moderator @bacon can assist you with his grateful advice on that.
Do I need this line of code as well, "ErrorDocument 404 /mywebsite.com/error/404.php" line?
404 error page whether it is php or html both needs the .htaccess code. and yes it needs to be put inside your websites directory's .htaccess.

Code: Select all

RewriteEngine on
ErrorDocument 404 http://www.yoursite.com/404.php
or in some cases

Code: Select all

RewriteEngine on
ErrorDocument 404 /errors/404.php

Very useful. Thank you!
Running WYSIWYG Web Builder since 2007...
Post Reply