× Here you can get community support related to ReDJ.

404 Error Page - How to use own template

  • Sunny Day
  • Topic Author
  • Offline
  • New Member
  • New Member
More
10 years 2 days ago #2294 by Sunny Day
404 Error Page - How to use own template was created by Sunny Day
Hi there

We have created a custom 404 error page and would like it to display using our website template rather than the default Joomla template 404 page styling. This means the page would have all of our normal website layout/styling, menu, footer, module settings. Luigi has posted this in answer to a similar question previously from another forum member (www.selfget.com/forum/redj/500-make-404-error-page-use-site-template.html):

"you can get what you need, because you can add a custom error page that can include your HTML and there's a macro to include an article content by its id. You could just generate the page you like, call it from the browser, copy all HTML code, and paste in a new error page, finally you can customize some parts to add info about error (using macros)."

Unfortunately I have not been able to work out the correct way to implement this. I have created a new Page 404 in ReDJ Manager and copied the html code from a browser for our bespoke 404 error page. I know this is not the correct solution as our module positions and some other template items do not display. I think we may need to add a custom error.css file in our template directory and then add the correct article ID and error.css file in ReDJ Manager. I just need some guidance so that everything works as it should. My skill level with Joomla is relatively low so I find step by step guides or actual examples easier to follow.

I spent some time trying to get the official Joomla method for 404 errors to work correctly. Unfortunately they all went to a 302 redirect which resolved to a 200 ok page which is apparently very bad for SEO purposes. This is why we are now trying to use ReDJ to solve the problem. Certainly our 404 error page which is now controlled by ReDJ seems to be resolving perfectly to a 404 page according to online redirect checkers so that is a good start.

I would like to say that ReDJ is an excellent extension and we are starting to use it more to help us to handle errors/redirects more efficiently than we have in the past.

If anyone can suggest a solution to getting the ReDJ 404 page to integrate correctly using our custom template that would be much appreciated. Thank you.

Please Log in or Create an account to join the conversation.

More
10 years 2 days ago #2295 by admin
Replied by admin on topic 404 Error Page - How to use own template
Hi,
I understand what you need and I know that adding just HTML to build the custom error page is not the best solution when you need to mimic a dynamic site look and feel.

But as you said is difficult to generate that kind of page (using normal Joomla rendering) with a 404 code. It should be a kind of "internal" call, but not sure if this is feasible (never tried).

Just give me a couple of days and I will play a little on this. But do not want to raise false expectations... :)

Kind regards,
Luigi

Please Log in or Create an account to join the conversation.

  • Sunny Day
  • Topic Author
  • Offline
  • New Member
  • New Member
More
10 years 2 days ago #2296 by Sunny Day
Replied by Sunny Day on topic 404 Error Page - How to use own template
Hello Luigi

Thank you very much for your quick reply and for offering to try to find a solution. Much appreciated.

Brian

Please Log in or Create an account to join the conversation.

More
9 years 11 months ago #2299 by admin
Replied by admin on topic 404 Error Page - How to use own template
Hi Brian,
tried and unfortunately I found no way to restart the application lifecycle in a clean way to render a different URL (the error page). But there's another way to do this, and I will test in the next few days. Site will call itself to get a fresh page content and change just header and few little things, and return as a custom error page, just like a reverse proxy. It is a kind of dirty workaround but it can work, and is not so dirty at the end... :)

Kind regards,
Luigi

Please Log in or Create an account to join the conversation.

  • Sunny Day
  • Topic Author
  • Offline
  • New Member
  • New Member
More
9 years 11 months ago #2300 by Sunny Day
Replied by Sunny Day on topic 404 Error Page - How to use own template
Thank you for your update Luigi. Good luck with your efforts in finding a workaround. Sorry to put you to all of this trouble.

Brian

Please Log in or Create an account to join the conversation.

More
9 years 11 months ago #2329 by admin
Replied by admin on topic 404 Error Page - How to use own template
Unfortunately up to now no internal "clean" solution has worked. I will try to implement the external solution in the next version to check if it works.

Kind regards,
Luigi

Please Log in or Create an account to join the conversation.

Time to create page: 0.103 seconds