ErrorDocument and permalinks

3 posts by 2 authors in: Forums > CMS Builder: Plugins & Add-ons
Last Post: June 26, 2015   (RSS)

By gregThomas - June 25, 2015

Hey Twocans, 

This is happening because the permalinks plugin htaccess code hijacks a 404 bad request, and attempts to load a page linked to a permalink instead (if there is one). Then if no permalink is found it loads the 404 page set in the permalinks plugin.

You can set the 404 page used on line 13 of permalinks plugin file:

$GLOBALS['PERMALINKS']['404_not_found_filepath']  = dirname(__FILE__) . '/permalinks_notFound404.php'; // filepath to include if Permalink isn't found

The 400/401/404/500 error pages you've set in htaccess should work correctly.

Thanks,

Greg

Greg Thomas







PHP Programmer - interactivetools.com

By Twocans - June 26, 2015

Thank You Greg,
I was afraid to manipulate any of the code of the extension in itself but hehe, following your advice all is fine.

$GLOBALS['PERMALINKS']['404_not_found_filepath']  = '../../../errtells/notfound.shtml'; // filepath to include if Permalink isn't found

The above didn't work

Thus all I did was get rid of the dirname(__FILE__) .  and created a dir with error files in my site aka www.mysitename.com/errtells/notfound.shtml

thanks very much for your help

have a great weekend

kenny