Jump to content
slobjones

404 Error Page Does Not Always Display Properly

Recommended Posts

I'm having an unusual problem with my 404 error page, which doesn't always appear in its proper form.

 

cPanel saves my 404 page in my root folder as 404.shtml. The thing works fine as long as the visitor mistypes a page name, in the form of mysite.com/wrongpage.php or something similar.

 

The problem occurs when the address is improperly named in the form of a folder, as in mysite.com/wrongpage/.

 

What happens then is my 404 page appears, but without the benefit of my style sheet. There appears to be a path problem that manifests itself only in this instance, that prevents the page from finding index.css.

 

Any idea on how to fix this problem?

Share this post


Link to post
Share on other sites

Well the first thing to check is make sure your 404 page is referencing the css file correctly. Put a full url to the css in the 404 page.

 

Second, make sure your 404 page is more than 512 bytes.

 

Third, make sure your .htaccess file contains

>ErrorDocument 404 http://yourdomain.ext/404.shtml

 

Personally I would rename the file 404.php, but that's just me. Be sure to change the .htaccess to reflect a page name change.

 

Check out some of these:

The Perfect 404

A Custom 404 Page

Fun Spoof Custom 404 Error Pages

Share this post


Link to post
Share on other sites
Third, make sure your .htaccess file contains

>ErrorDocument 404 http://yourdomain.ext/404.shtml

 

I didn't know that! Learned something new today :(

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...