Custom 404 page not displaying

For questions and problems with the CMS core. This board is NOT for any 3rd party modules, addons, PHP scripts or anything NOT distributed with the CMS made simple package itself.
Post Reply
AlasdairGF
Forum Members
Forum Members
Posts: 25
Joined: Tue Jan 20, 2009 3:36 pm

Custom 404 page not displaying

Post by AlasdairGF »

I've designed couple of custom error pages using one of my regular templates, unattached it from the menu item, and added the following to my .htaccess:

Code: Select all

ErrorDocument 404 http://www.mydomain.org/index.php/error404
ErrorDocument 500 http://www.mydomain.org/index.php/error500
As you can see, I'm using pretty urls.  So far so ordinary, as far as I can tell?  To check that the page is working, I navigate to http://www.mydomain.org/index.php/error404 and sure enough, there's the page I designed complete with the sarcastic comment designed to irritate & confuse.  That's what 404 pages are for, surely?!

However, when I try to go to www.mydomain.org/bla (which doesn't exist), I just get redirected to the site's home page.  Have tried this both with the "Enable Custom 404 Message" checkbox in "Site Admin > Global Settings" both ticked and un-ticked and no difference (in neither case do I get the placeholder text I put in for my "Custom 404 message" either!).

What am I doing wrong?  I'm guessing there's something really silly that I've overlooked, but can't for the life of me think what it might be.

Me: CMSMS 1.5.2 on Apache 2.2.11 with PHP 5.2.5 and MySQL 5.0.51a.
You: Cleverer than me with a quick & easy solution!

(Also, out of curiosity, what other error pages might be necessary?)
AlasdairGF
Forum Members
Forum Members
Posts: 25
Joined: Tue Jan 20, 2009 3:36 pm

Re: Custom 404 page not displaying

Post by AlasdairGF »

Additionally: If I go to www.stonewaterzen.org/index.php/bla then I do get the custom 404 page.  But again, if I just go to http://www.stonewaterzen.org/bla then I'm re-directed to the site's home page and not the 404 page.

Any ideas? Anyone?
Last edited by AlasdairGF on Fri Feb 06, 2009 12:31 pm, edited 1 time in total.
spcherub
Power Poster
Power Poster
Posts: 402
Joined: Fri Jun 06, 2008 5:54 pm

Re: Custom 404 page not displaying

Post by spcherub »

Setting the redirects in the htaccess file means that the web server processes this before index.php (CMSMS) gets to look at it.

I'm not exactly sure how you have things setup, but with pretty URLs, you should be able to get to any (valid) page with http://www.mydomain.org/page instead of http://www.mydomain.org/index.php/page - Check if this works for a valid page. If it does, then update your redirects to use this instead.

Also if you are trapping 404s in the htaccess file, then the 404 mechanism built into CMSMS will not have a chance to work. To confirm this, comment out the 404 redirect in the htaccess file, then enable custom 404 in the Global Settings - it should work now. I know this does not solve you 500 dilemma but at least you can get one of the two working.

S
cronosmachine
Forum Members
Forum Members
Posts: 23
Joined: Thu Jun 17, 2010 12:48 am

Re: Custom 404 page not displaying

Post by cronosmachine »

Hi,
I'm using CMS 1.7.1 "Escada".
I'm also do not understand how to use Site Admin » Global Settings » Custom 404 Handling admin console.
I already apply this setting, but when type in error path e.g. http://domain/bla it give me:
Object not found!

The requested URL was not found on this server. If you entered the URL manually please check your spelling and try again.

If you think this is a server error, please contact the webmaster.
Error 404
domain
17-Jun-10 8:51:35 AM
Apache/2.2.14 (Win32) DAV/2 mod_ssl/2.2.14 OpenSSL/0.9.8l mod_autoindex_color PHP/5.3.1 mod_apreq2-20090110/2.7.1 mod_perl/2.0.4 Perl/v5.10.1

This both same with or without checking "Enable Site Down Message"
What could be the cause this problem?
How to fix it?
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am

Re: Custom 404 page not displaying

Post by Dr.CSS »

FYI you can now make a 404 error page like making/adding normal content pages, look in the content typew drop down...
cronosmachine
Forum Members
Forum Members
Posts: 23
Joined: Thu Jun 17, 2010 12:48 am

Re: Custom 404 page not displaying

Post by cronosmachine »

Dr.CSS wrote: FYI you can now make a 404 error page like making/adding normal content pages, look in the content typew drop down...
Sorry perhaps I not really understand what is the idea using error page on content (Content » Pages » Add New Content » Content Type: Error Page) and between site custom 404 handling (Site Admin » Global Settings » Custom 404 Handling) ?

Are you try to say site custom 404 handling (Site Admin » Global Settings » Custom 404 Handling) is not working? and batter using error page on content (Content » Pages » Add New Content » Content Type: Error Page) ?
Post Reply

Return to “CMSMS Core”