Custom 404 pages.. making them work...
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
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
Custom 404 pages.. making them work...
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?
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.
Re: Custom 404 pages.. making them work...
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.
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.
-
-
- Posts: 1439
- Joined: Fri Aug 21, 2020 8:27 am
- Contact:
Re: Custom 404 pages.. making them work...
In your case I think it should be more likekreemerz 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?
ErrorDocument 404 /404.html
If you have a single 404 error page along with your normal pages
Re: Custom 404 pages.. making them work...
Hmm... still not showing up... should I edit the htaccess file within Cpanel?wwonderfull wrote: ↑Sat Apr 23, 2022 9:15 pmIn your case I think it should be more likekreemerz 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?
ErrorDocument 404 /404.html
If you have a single 404 error page along with your normal pages
or create my own htaccess file?
Re: Custom 404 pages.. making them work...
You should edit the .htaccess file.
Re: Custom 404 pages.. making them work...
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.
You don’t need to include your website, just the error page.
- KingSparta
-
- Posts: 269
- Joined: Tue Dec 08, 2020 6:00 pm
- Location: Earth
- Contact:
Re: Custom 404 pages.. making them work...
On Godaddy, the extender is not HTML,it is ".shtml"
My 404 page
https://myaagrapevines.com/404.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)
https://MyAAGrapevines.com
https://CenterCityBBS.Com (Grupo Chat, & Forum)
- BaconFries
-
- Posts: 5641
- Joined: Thu Aug 16, 2007 7:32 pm
Re: Custom 404 pages.. making them work...
@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.On Godaddy, the extender is not HTML,it is ".shtml"
Re: Custom 404 pages.. making them work...
https://privatebin.support-tools.com/?a ... VEBMGA4ro=
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.
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.
- KingSparta
-
- Posts: 269
- Joined: Tue Dec 08, 2020 6:00 pm
- Location: Earth
- Contact:
Re: Custom 404 pages.. making them work...
I was not saying that, only that GoDaddy's default is shtmlBaconFries wrote: ↑Sun Apr 24, 2022 1:47 am@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.On Godaddy, the extender is not HTML,it 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)
https://MyAAGrapevines.com
https://CenterCityBBS.Com (Grupo Chat, & Forum)
- BaconFries
-
- Posts: 5641
- Joined: Thu Aug 16, 2007 7:32 pm
Re: Custom 404 pages.. making them work...
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.My page works but the text and everything is all jumbled up... doesn't look anything like the orginal.
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]
Code: Select all
[img]https://www.yoursiteurl.com/yourimg.jpg[/img]
Re: Custom 404 pages.. making them work...
So it does need to be a PHP file?
- BaconFries
-
- Posts: 5641
- Joined: Thu Aug 16, 2007 7:32 pm
Re: Custom 404 pages.. making them work...
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
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.
Code: Select all
<?php http_response_code(404); include('your404.php'); // provide your own HTML for the error page die();?>
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.
Re: Custom 404 pages.. making them work...
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.
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.
-
-
- Posts: 1439
- Joined: Fri Aug 21, 2020 8:27 am
- Contact:
Re: Custom 404 pages.. making them work...
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.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
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.
Re: Custom 404 pages.. making them work...
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.wwonderfull wrote: ↑Sun Apr 24, 2022 5:13 am404 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.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
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.
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?
-
-
- Posts: 1439
- Joined: Fri Aug 21, 2020 8:27 am
- Contact:
Re: Custom 404 pages.. making them work...
For the php code I can say our dear moderator @bacon can assist you with his grateful advice on that.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?
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.Do I need this line of code as well, "ErrorDocument 404 /mywebsite.com/error/404.php" line?
Code: Select all
RewriteEngine on
ErrorDocument 404 http://www.yoursite.com/404.php
Code: Select all
RewriteEngine on
ErrorDocument 404 /errors/404.php
Re: Custom 404 pages.. making them work...
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=
https://privatebin.support-tools.com/?7 ... GqXMDQdYI=
Re: Custom 404 pages.. making them work...
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
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
Re: Custom 404 pages.. making them work...
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 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
Re: Custom 404 pages.. making them work...
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.
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.
Re: Custom 404 pages.. making them work...
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.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.
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.
Re: Custom 404 pages.. making them work...
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.
So if you are creating and publishing your error page project in the /error folder then that's exactly how my setup is.
-
-
- Posts: 1439
- Joined: Fri Aug 21, 2020 8:27 am
- Contact:
Re: Custom 404 pages.. making them work...
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.
Re: Custom 404 pages.. making them work...
Still paste the same html code into the .htaccess file?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.
Re: Custom 404 pages.. making them work...
Okay. I might have done that. But I'll give it a try again.
Re: Custom 404 pages.. making them work...
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...
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...
Re: Custom 404 pages.. making them work...
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.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.
@wwonderfull had suggested the 'html error page' way of doing this.. I'm now wondering if that may be less of a hassle.
-
-
- Posts: 1439
- Joined: Fri Aug 21, 2020 8:27 am
- Contact:
Re: Custom 404 pages.. making them work...
404 error page is very simple to know.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.
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.
Re: Custom 404 pages.. making them work...
wwonderfull wrote: ↑Sun Apr 24, 2022 6:44 amFor the php code I can say our dear moderator @bacon can assist you with his grateful advice on that.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?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.Do I need this line of code as well, "ErrorDocument 404 /mywebsite.com/error/404.php" line?or in some casesCode: Select all
RewriteEngine on ErrorDocument 404 http://www.yoursite.com/404.php
Code: Select all
RewriteEngine on ErrorDocument 404 /errors/404.php
Very useful. Thank you!
Running WYSIWYG Web Builder since 2007...