Custom 404 Page (Page Not Found) with 301 redirects.
Permalink
Hi,
First, just FYI: I have found that adding a page_not_found.php file to my custom theme has NO EFFECT if "Elemental" is installed, even though mine is active. After deleting Elemental my file used just fine. BUG!
We converted an old site to C5. The customer now wants the old URLs redirected to the new C5 urls. Since .htaccess redirection is slow and affects every server access, I opted to redirect these files from a custom 404 Page. This way only the 404 pages hit the code and it does not slow the entore site down. This SHOULD work perfectly, but the header_remove() function is not removing the 404 header added by C5 (or it is being added after my 301 redirect header. I have hacked it by adding JS to redirect the page for my special case urls.
Is there a way to remove Concrete5's 404 header in the custom 404 page?
Thanks,
Sean
First, just FYI: I have found that adding a page_not_found.php file to my custom theme has NO EFFECT if "Elemental" is installed, even though mine is active. After deleting Elemental my file used just fine. BUG!
We converted an old site to C5. The customer now wants the old URLs redirected to the new C5 urls. Since .htaccess redirection is slow and affects every server access, I opted to redirect these files from a custom 404 Page. This way only the 404 pages hit the code and it does not slow the entore site down. This SHOULD work perfectly, but the header_remove() function is not removing the 404 header added by C5 (or it is being added after my 301 redirect header. I have hacked it by adding JS to redirect the page for my special case urls.
Is there a way to remove Concrete5's 404 header in the custom 404 page?
Thanks,
Sean
There is a tutorial for custom error pages:
https://documentation.concrete5.org/tutorials/how-create-404-page-pa...
Kind Regards,
Peter