Page 1 of 1

404 page

Posted: Fri Mar 12, 2021 2:26 pm
by Jerry
I need Help.
I accidently delete some files in my root directory... All back working fine except for my custom 404 page.
This what I have:
A custom 404 page with .shtml extension
.htacces.txt file with this in it: ErrorDocument 404 /404.shtml

Here is the weird thing, If you create an error that is in the root directory it will work fine.
Example: https://www.edesignsplans.ca/custom_home_Wesigns.html
But if I try to create one from a sub folder it's all messed up.
Example: https://www.edesignsplans.ca/e-designs_ ... plans.html

I'm sure it's something I messed up.
Thank you in advance

Re: 404 page

Posted: Fri Mar 12, 2021 3:07 pm
by WWBman
Not sure if this helps but the Emotions_Guy is missing in the second one.

Re: 404 page

Posted: Fri Mar 12, 2021 3:11 pm
by Jerry
Thanks for the reply.
I know.. and the page is messed up in all 4 of my break points in the error pages that are not from the root directory?
Hopefully someone will know what I screwed up.

Re: 404 page

Posted: Fri Mar 12, 2021 7:37 pm
by alan_sh
A vague memory says this has been reported before. But I cannot remember the solution.

Re: 404 page

Posted: Fri Mar 12, 2021 7:42 pm
by Jerry
Actually it was my post a couple of years ago, but I followed the advise at that time but it doesn't seem to work.

This was the post..https://www.wysiwygwebbuilder.com/forum ... 04#p436381
Maybe a 68 year shouldn't be doing this anymore.. lol

Re: 404 page

Posted: Sat Mar 13, 2021 9:40 am
by alan_sh
How did you know how old I was? :) - and I'm not stopping just yet :D :D

Re: 404 page

Posted: Sat Mar 13, 2021 2:51 pm
by Fender
When you look to the console errors of the webdeveloper you can see that the css file
https://www.edesignsplans.ca/e-designs_ ... splans.css
not can be loaded. If you look at sources you can see that this css file is empty!
I copied the css of your first error page to the screwed up one and you have your layout back!
I guess that your css file for the second error page is'nt present and also the images you are missing
Maybe this way you can figure out where you went wrong
Wi-level_plans.html:4 The key "initial" is not recognized and ignored.

Code: Select all

here the log;
Confused-emoticon-wordpress-offers-distraction-free-writing-who-knew-cliparts.jpg:1 Failed to load resource: the server responded with a status of 404 ()

Email.-3.jpg:1 Failed to load resource: the server responded with a status of 404 ()

img0058.png:1 Failed to load resource: the server responded with a status of 404 ()
Wi-level_plans.html:1 Failed to load resource: the server responded with a status of 404 ()
www.edesignsplans.css:1 Failed to load resource: the server responded with a status of 404 ()
Success

Re: 404 page

Posted: Sat Mar 13, 2021 3:26 pm
by WWBman
When you recreated your 404 error page did you have the option "Generate external CSS style sheets for page specific styles" set?
If so then unset it to ensure that CSS is used inline.
(I always have this option set except for my error page.)

Re: 404 page

Posted: Sat Mar 13, 2021 4:52 pm
by Jerry
Fender and WWBman

Thanks for your replies.
I'm still confused.. (Doesn't take much)
If I turn off "Generate external CSS style sheets for page specific styles" i don't get 404.css for the 404 page. Is that what should happen?
This is a screen shot of my option settings for the 404 page. https://www.edesignsplans.ca/temp/404%2 ... ptions.JPG

I read that the .html should be .shtml (Which I have done)
My .htaccess reads: ErrorDocument 404 /404.shtml
The actual 404 page works https://www.edesignsplans.ca/404.shtml but it will not load when I enter a wrong url in other pages that are NOT sitting in the root directory.

I'm stumped.. :(

Re: 404 page

Posted: Sat Mar 13, 2021 5:09 pm
by WWBman
My options are the same except I don't have "Generate single CSS style sheet for global styles" set although this may not be relevant.
Is the .htaccess file in the root the only one?
I wondered if you had any in the folders as well.

Re: 404 page

Posted: Sat Mar 13, 2021 5:33 pm
by Jerry
I check and I don't see any other .htaccess.text file in any other folders.
This is strange as it all worked before I accidently deleted some things..
Hmmm
Thanks

Re: 404 page

Posted: Sat Mar 13, 2021 5:50 pm
by BaconFries
I check and I don't see any other .htaccess.text file
Jerry the .htacces file has no extension .txt to it, the file is just named .htacces Regarding accidentally deleting files do you not have a backup feature on your host / server that you can do a recovery? Check with your provider on this as they should be able to help you with this.

Re: 404 page

Posted: Sat Mar 13, 2021 6:02 pm
by Jerry
BaconFries

yes I type it wrong, I have it as .htaccess
As for the backup I'm embarrassed to say I never had it enabled... BUT I will once I get this fixed for sure. :cry:
I just don't understand, this worked before I don't know what I doing wrong.
But really appreciate everyone trying to help.
This has to be the best forum ever.

Re: 404 page

Posted: Sat Mar 13, 2021 6:12 pm
by WWBman
So only some files in the root directory were deleted.
Was the .htaccess file deleted?
If you recreated it there may have been some more content that the host added that needs to be there also.
What exactly did you do to recreate the deleted files?

EDIT:
One thing I'm curious about.
In the source there is a line:

Code: Select all

<link href="www.edesignsplans.css" rel="stylesheet">
How did that get there?

EDIT2:
Actually, I think the option "Generate single CSS style sheet for global styles" should not be set.
That's what has generated that line, I think.

Re: 404 page

Posted: Sat Mar 13, 2021 7:14 pm
by Fender
I don't have "Generate single CSS style sheet for global styles" set although this may not be relevant.
As I look at yout other pages you have set in options "Generate single CSS style sheet for global styles" that's what you also
have to set on your error page to get the missing css file

Re: 404 page

Posted: Sat Mar 13, 2021 8:39 pm
by Jerry
In order to get the 404.css file it seem you need to have on also "Generate external CSS style sheets for page specific styles"
as I tried just using Generate single CSS style sheet for global styles and that never gave me a 404.css file.
But if upload the 404.shtml and the 404.css file get all mixed up.
Without it the page loads but with errors. If I just load the actual 404 separately it works fine.
I don't know how to fix this.
Ticks me off that I had it all working fine before I messed it up.

Re: 404 page

Posted: Sun Mar 14, 2021 4:23 pm
by Jerry
Day two..
First off I want to thank all for being patient with this old guy.. :)
So I have my custom 404 page made and uploaded to my root directory.
When I create an error in any page in the root directory the 404 page works perfect.
Ex: https://www.edesignsplans.ca/custom_hom ... $$$$$.html
Now when I create an error in any page that is in a sub folder such as below the images will not load or show?
EX: https://www.edesignsplans.ca/e-designs- ... s$$$$.html
I do have a .htaccess file in the root directory with this ErrorDocument 404 /404.shtml
I have some screen shots of my settings to show at these links below:
https://www.edesignsplans.ca/temp/General-options.JPG
https://www.edesignsplans.ca/temp/html-options.JPG
I am totally stumped.. This is beyond my knowledge for sure.
Thank you for any help at all.
Jerry

Re: 404 page

Posted: Sun Mar 14, 2021 4:50 pm
by WWBman
When I go to the 2 examples they both look identical except the second one can't find the image.confused.jpg file.
So something has changed since yesterday.
This file has a relative address i.e. images/image_confused.jpg so it may not be looking for the file in the root.
You may have to make it an absolute address i.e. https://www.edesignsplans.ca/images/image_confused.jpg

Re: 404 page

Posted: Sun Mar 14, 2021 5:40 pm
by Jerry
Thanks for your response.
Yes in the second example it can't find the emotion guy nor the image for the email link but yet it finds other images
such as my logo, the pinterest and facebook links?
Someone mentioned that there needed to be a 404.css file but when I do that this is the result.
https://www.edesignsplans.ca/e-designs- ... s$$$$.html but then again the 404 works if it come from a page in the root directory.
I tried using a page that I already have working that had lots of images and text (house-plans)
as the 404 page and it all worked.
There is nothing different about those image from the images I am using on the 404 page.
I did try making a new page once before but will try again.

Re: 404 page

Posted: Sun Mar 14, 2021 5:48 pm
by WWBman
Are you absolutely certain it worked before when accessing a sub-folders.
On my simple error page I have only one link to another page and that is specified as an absolute link.

Re: 404 page

Posted: Sun Mar 14, 2021 5:57 pm
by Jerry
Yes it worked before.
For example when some click on say https://www.edesignsplans.ca/e-designs- ... ns-16.html and there was an error the error page would respond and error page was in the root directory.
It has to be something on the 404 page or master page I use that is wrong, but what?
Thanks again

Re: 404 page

Posted: Sun Mar 14, 2021 6:08 pm
by Fender
I have the .htaccess file with this on it "ErrorDocument 404 https://www.edesignsplans.ca/404.shtml" uploaded to the root directory.
This is on your old posthttps://www.wysiwygwebbuilder.com/forum ... 04#p436381
What if you put this on the htaccess that is a absolut path
https://wpassist.me/how-to-htaccess-use ... nt-folder/
make a copy of what you have before and give it a try, don't use page specific css
Herehttps://httpstatus.ioyou can check if you get a return of the correct HTTP status code
on this forun they also have this problem
https://forums.mobirise.com/discussion/ ... tside-root

Re: 404 page

Posted: Sun Mar 14, 2021 6:29 pm
by Jerry
THANK YOU... Thank you Everyone!!!
If you lived in the neighborhood I'd be buying lunch and beers..
This is what I put in the .htaccess file: ErrorDocument 404 https://www.edesignsplans.ca/404.shtml
And that seems to have done the trick.
Now to backup my website.
Thanks for helping an old fart out.
Stay safe..
Jerry

Re: 404 page

Posted: Sun Mar 14, 2021 6:50 pm
by Fender
Áctualy now it is a 302 redirect to your errorpage. You can check this https://httpstatus.io
past there https://www.edesignsplans.ca/e-designs- ... s$$$$.html
and you will get the 302 redirect code

But for now it is working
You have to ask the hosting company how to get the right htacess file
and settings for your 404 page, maybe a cpanel settting
Fender

Re: 404 page

Posted: Sun Mar 14, 2021 7:18 pm
by Jerry
thanks again
All the best