URL to Custom 404 message

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.
Locked
badhoy

URL to Custom 404 message

Post 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?
Sonya

Re: URL to Custom 404 message

Post 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
Pierre M.

Re: URL to Custom 404 message

Post 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.
cyberman

Re: URL to Custom 404 message

Post 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.
Sonya

Re: URL to Custom 404 message

Post 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
Sonya

Re: URL to Custom 404 message

Post 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.
cyberman

Re: URL to Custom 404 message

Post by cyberman »

Upps, my support brain (and fingers) were faster than my eyes :) ...
Locked

Return to “CMSMS Core”