WIP: 404 Error Page NOT showing for "%root_url%/%some_page%" when Permalink is set up with static as "%root_url%/blog/%postname%"

Hi,

I’ve created an Error Page template in Bricks builder .
My permalink is setup as “%root_url%/blog/%postname%”
where

  • %root_url%” is our domain name
  • /blog” is a static in the URL so I’d have search/categories/posts be directed to “…/blog/<category/search/post>” URL when using archive/search/post template setup.

But this creates a problem when setting up the Error Page Template .
It works great when I use url “/blog/<random_slug_in_url>

BUT when navigating directly to “www.myrndmdomain33.com/<random_slug_in_url>” eg.
http://www.myrndmdomain33.com/gibberishslug404throw”, it renders the default Bricks " Whoops, that page is gone" template.

I looked into other topics on this forum, it was suggested to create a filter for active templates, for example,

function itchy_disable_uncategorized_category_archives( $active_templates, $post_id, $content_type) {
if ( is_single() && is_category( ‘uncategorized’ ) ) {
global $wp_query;
$wp_query->set_404();
status_header( 404 );

// Set the active templates to 404 template
$active_templates['content'] = 196850; //Set error template ID 
$active_templates['error'] = 196850; // Set error template ID 
$active_templates['content_type'] = 'error';

}
return $active_templates;
}

But this does not catch it.

I assume it doesn’t fall under categorization. I’d need to set up the right conditions, then it would work, but I have no clue what the checks should be there . I tried it without any checks and it renders the Error Page Template.
How do I set up the routing for anything before “/blog” permalink to render the custom 404 Error Template I created ? example “www.myrandomdomain.com/gibberishslug404throw” ? (without the static “/blog” in URL)

TLDR;

  1. Permalink has following setup “/blog/%postname%” .
  2. Custom Error Template for the following URLs:
  1. How to display Custom Error Template for the first URL also ? Without breaking the /blog permalink setup.

Hi Ardi,
Thanks so much for your report!

We have already received a similar email report so I will add your report to the existing task.

Nevertheless, it would be helpful if you could send temporary access data and a link to this thread to help@bricksbuilder.io.

Best regards,
timmse

@timmse Hey!
Haven’t heard any response from Bricks side (not even a response to email) .
Are you guys actively working on this issue?

Thanks

Hi Ardi,
As I said, I have added your report to the existing task and mentioned separately that we have received access data from you. Please leave the installation until we mark this thread as solved.

Alright, thanks for the update!