Page 1 of 1

URL to Custom 404 message

Posted: Thu Mar 09, 2006 6:30 pm
by badhoy
I need to include a link to my custom 404 message in my .htaccess file.  What would this url look like to get to the CMSMS custom 400 error message?

Re: URL to Custom 404 message

Posted: Sat Jun 23, 2007 4:13 pm
by Sonya
Hello,

if you require this in your action script, you can just use

Code: Select all

header('Location:/index.php?page=notfound');
Assumed you have no page with alias 'notfound' you will be redirected to the CMSMS Custom 404 Error page.

Sonya

Re: URL to Custom 404 message

Posted: Sat Jun 23, 2007 6:22 pm
by Pierre M.
Hello,

or rather than finding a non existing URL to redirect to to be redirected to an error page (not enough KISS to my feeling), you could adjust the scope of your existing err404 settings. I mean something like this in httpd.conf or .htaccess :

Code: Select all

#the rewrite conds and rules about the /cmsms/ installation
#same as sample .htaccess
#that way, CMSms should catch 404 within its rewritten URL scope

#then only, the non CMSms scoped err 404 statement
<Directory> or <DirectoryMatch> or <Location> or <LocationMatch> /only/outside/of/cmsms*
ErrorDocument 404 /some/path/to/404.html
</Directory> or </DirectoryMatch> or </Location> or </LocationMatch>
Sample httpd.confS tend to have a global scope (/) 404 setting and you (and others) want :
-no setting for /cmsms...
-in webserver setting for /else...

Hope this helps, I think I'm not easy to read tonight ;)

Pierre M.

Re: URL to Custom 404 message

Posted: Sat Jun 23, 2007 8:10 pm
by cyberman
badhoy wrote: I need to include a link to my custom 404 message in my .htaccess file.
Not sure if you know it - CMSms has a built in possibility to set your own 404 message (admin panel, site admin > global settings) so you dont need htaccess for that.

Re: URL to Custom 404 message

Posted: Sat Jun 23, 2007 8:40 pm
by Sonya
Hello Pierre,

the question was how to redirect to CMSMS 404 custom error page. For your solution I need to know the URL of this page that I can place in .htaccess or httpd.conf. I was not able to figure out the URL and therefore I use the trick with non-existing alias.

Sonya

Re: URL to Custom 404 message

Posted: Sat Jun 23, 2007 8:51 pm
by Sonya
cyberman wrote: Not sure if you know it - CMSms has a built in possibility to set your own 404 message (admin panel, site admin > global settings) so you dont need htaccess for that.
It will not catch the requests which do not include index.php in it. If you try to call something like http://yourcmssite/badurl.php you will not get the custom 404 error of CMS Made Simple but the error site of your server.

Re: URL to Custom 404 message

Posted: Sat Jun 23, 2007 9:21 pm
by cyberman
Upps, my support brain (and fingers) were faster than my eyes :) ...