Community @ The Turning Gate

Support community for TTG plugins and products.

NOTICE

The Turning Gate's Community has moved to a new home, at https://discourse.theturninggate.net.

This forum is now closed, and exists here as a read-only archive.

  • New user registrations are disabled.
  • Users cannot create new topics.
  • Users cannot reply to existing topics.

You are not logged in.

#1 2016-11-01 03:20:00

charlie.choc
Member
From: Marietta, GA
Registered: 2014-01-09
Posts: 359
Website

Custom 404 page

I had a custom 404 page with CE4 using .htaccess but can't seem to figure out how to do the same with backlight. The html page I generated with CE4 had the same menus, etc., as the rest of the site.

Thanks.

Offline

#2 2016-11-01 03:40:39

charlie.choc
Member
From: Marietta, GA
Registered: 2014-01-09
Posts: 359
Website

Re: Custom 404 page

I tried that and I also tried to direct 404 errors to backlight/search/index.php with no joy. I also tried the ErrorDocument directive in the config file in the Apache2 sites-enabled directory.

Is there a way to generate an html page with all of the backlight configurations (theme, menus, masthead, etc)?

Offline

#3 2016-11-01 03:42:16

rod barbee
Moderator
From: Port Ludlow, WA USA
Registered: 2012-09-24
Posts: 17,830
Website

Re: Custom 404 page

sorry, I removed my earlier reply when I found it didn't work. Matt will have to address the issue.

Is there a way to generate an html page with all of the backlight configurations (theme, menus, masthead, etc)?

no, not that I know of.


Rod 
Just a user with way too much time on his hands.
www.rodbarbee.com
ttg-tips.com, Backlight 2/3 test site

Offline

#4 2016-11-01 07:13:38

Ben
Moderator
From: Melbourne, Australia
Registered: 2012-09-29
Posts: 4,399

Re: Custom 404 page

I'm building 404 handling into Backlight for 1.1.  It should allow you to set the message text in Markdown format, and will be placed within a Backlight page template.

Handling this for invalid page links (e.g. http://mysite.com/broken/) is straightforward.  Handling for galleries less so.  We had issues in the past where invalid gallery links were handled by the galleries function, which broke the paths to resources in the generated templates.  We need to be careful to avoid that scenario.

Offline

#5 2016-11-01 07:15:40

charlie.choc
Member
From: Marietta, GA
Registered: 2014-01-09
Posts: 359
Website

Re: Custom 404 page

Thanks

Offline

#6 2016-11-02 23:05:53

SunFoxNC
Member
Registered: 2015-09-04
Posts: 80

Re: Custom 404 page

Ben wrote:

I'm building 404 handling into Backlight for 1.1.  It should allow you to set the message text in Markdown format, and will be placed within a Backlight page template.

Handling this for invalid page links (e.g. http://mysite.com/broken/) is straightforward.  Handling for galleries less so.  We had issues in the past where invalid gallery links were handled by the galleries function, which broke the paths to resources in the generated templates.  We need to be careful to avoid that scenario.

Are you planning on adding handling for the other common errors (500 in particular comes to mind) in addition to 404?

Offline

#7 2016-11-03 05:08:24

Ben
Moderator
From: Melbourne, Australia
Registered: 2012-09-29
Posts: 4,399

Re: Custom 404 page

SunFoxNC wrote:

Are you planning on adding handling for the other common errors (500 in particular comes to mind) in addition to 404?

Backlight reports all errors that are possible to catch, including many 500s that would previously have resulted in empty pages. These are presented as red errors that we don't plan to customise - take it as a hint that something is wrong and needs fixing.

That leaves some 500s that we have absolutely no way of catching, such as errors in .htacess files, which trip up the request before the request reaches Backlight.

Offline

#8 2017-08-15 15:44:39

richam
Member
From: Preveza, Greece
Registered: 2013-01-06
Posts: 143
Website

Re: Custom 404 page

Gave up with using the .htaccess file that I was using on CE4 as an error trap, but still wanted to get a 404 error page that wouldn't scare away viewers who might have mis-typed something.  So, built an ersatz page within Backlight>Settings.  You can see the result here: http://www.michaelrichardsphotography.com/xxxx/.

I picked my normal page as "Page not Found Template", and built the fake page within "Page not Found Message".  Here's the message input:

<h2><center><font color=red>Error 404 - not found.</font>  Oops, you made a wrong turn somewhere</center></h2>
<u>[<center>**Return Home**](/)</u>           <u>[**Complaint Department**</center>](http://www.michaelrichardsphotography.com/contact/)</u>

![](/graphics/WrongPath.jpg)

Seems to have solved the problem for me.

Offline

#9 2017-08-15 18:06:07

Ben
Moderator
From: Melbourne, Australia
Registered: 2012-09-29
Posts: 4,399

Re: Custom 404 page

Nice work.

Offline

#10 2017-08-15 19:21:11

richam
Member
From: Preveza, Greece
Registered: 2013-01-06
Posts: 143
Website

Re: Custom 404 page

Ben wrote:

Nice work.

Thanks.  Still working on it, but may get to understand this system yet.

Offline

Board footer

Powered by FluxBB