Hi Team,
I am trying to create the custom 404 page, and below are the error.php code, but its not redirecting to 404 page. Please help me to sort this out.

Hi Team,
I am trying to create the custom 404 page, and below are the error.php code, but its not redirecting to 404 page. Please help me to sort this out.

Hi there!
Thanks for contacting us.
Have you checked and follow the blog post already, please?
https://www.joomshaper.com/blog/create-a-custom-joomla-404-page-with-sp-page-builder
Best Regards
In joomla4 this dont work with sp pagebuilder pages. normal pages like blog and blog-detail work. i get a redirect to home when i add code like yours. hope joomshaper find the error. think its a seo-friendly-url problem with sp pagebuilder...